fix_: wait for mailserver available signal to change missing messages criteria (#5686)

This commit is contained in:
richΛrd 2024-08-16 14:26:10 -04:00 committed by GitHub
parent c02ebf957c
commit 4aa51f9882
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 0 deletions

View File

@ -396,11 +396,17 @@ func (m *Messenger) checkForMissingMessagesLoop() {
t := time.NewTicker(missingMessageCheckPeriod) t := time.NewTicker(missingMessageCheckPeriod)
defer t.Stop() defer t.Stop()
mailserverAvailableSignal := m.SubscribeMailserverAvailable()
for { for {
select { select {
case <-m.quit: case <-m.quit:
return return
// Wait for mailserver available, also triggered on mailserver change
case <-mailserverAvailableSignal:
mailserverAvailableSignal = m.SubscribeMailserverAvailable()
case <-t.C: case <-t.C:
} }