Skip to content

Commit

Permalink
Speed up get_new_uids #notests
Browse files Browse the repository at this point in the history
  • Loading branch information
squeaky-pl committed Nov 7, 2024
1 parent 24add99 commit 5d7290a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions inbox/mailsync/backends/imap/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -801,8 +801,8 @@ def get_new_uids(self, crispin_client):
latest_uids = crispin_client.conn.fetch(f"{lastseenuid + 1}:*", ["UID"]).keys()
new_uids = set(latest_uids) - {lastseenuid}
if new_uids:
for uid in sorted(new_uids):
self.download_and_commit_uids(crispin_client, [uid])
for new_uid_chunk in chunk(sorted(new_uids, reverse=True), 100):
self.download_and_commit_uids(crispin_client, new_uid_chunk)
self.uidnext = remote_uidnext

def condstore_refresh_flags(self, crispin_client: CrispinClient) -> None:
Expand Down

0 comments on commit 5d7290a

Please sign in to comment.