Pop recently seen loop event out of the queue when it's in the past

This commit is contained in:
link2xt
2022-11-14 22:49:06 +00:00
parent c1f9d8f7a1
commit ee34b64f5d
2 changed files with 13 additions and 0 deletions

View File

@@ -11,6 +11,8 @@
### Fixes
- improve IMAP logging, in particular fix incorrect "IMAP IDLE protocol
timed out" message on network error during IDLE #3749
- pop Recently Seen Loop event out of the queue when it is in the past
to avoid busy looping #3753
## 1.100.0

View File

@@ -1543,6 +1543,17 @@ impl RecentlySeenLoop {
unseen_queue.push((Reverse(timestamp + SEEN_RECENTLY_SECONDS), contact_id));
}
}
} else {
info!(
context,
"Recently seen loop is not waiting, event is already due."
);
// Event is already in the past.
if let Some(contact_id) = contact_id {
context.emit_event(EventType::ContactsChanged(Some(*contact_id)));
}
unseen_queue.pop();
}
}
}