fix: decouple permissions reevaluation from torrent client readiness
This commit is contained in:
parent
bd245ab45b
commit
dc6fe5613a
|
@ -835,22 +835,24 @@ func (m *Messenger) Start() (*MessengerResponse, error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if m.torrentClientReady() {
|
|
||||||
controlledCommunities, err := m.communitiesManager.Controlled()
|
controlledCommunities, err := m.communitiesManager.Controlled()
|
||||||
if err == nil && len(controlledCommunities) > 0 {
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.torrentClientReady() {
|
||||||
available := m.SubscribeMailserverAvailable()
|
available := m.SubscribeMailserverAvailable()
|
||||||
go func() {
|
go func() {
|
||||||
<-available
|
<-available
|
||||||
m.InitHistoryArchiveTasks(controlledCommunities)
|
m.InitHistoryArchiveTasks(controlledCommunities)
|
||||||
}()
|
}()
|
||||||
|
}
|
||||||
|
|
||||||
for _, c := range controlledCommunities {
|
for _, c := range controlledCommunities {
|
||||||
if c.Joined() && c.HasTokenPermissions() {
|
if c.Joined() && c.HasTokenPermissions() {
|
||||||
go m.communitiesManager.ReevaluateMembersPeriodically(c.ID())
|
go m.communitiesManager.ReevaluateMembersPeriodically(c.ID())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
joinedCommunities, err := m.communitiesManager.Joined()
|
joinedCommunities, err := m.communitiesManager.Joined()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue