Skip to content

Commit

Permalink
guard by initial
Browse files Browse the repository at this point in the history
  • Loading branch information
squeaky-pl committed Nov 8, 2024
1 parent 954061f commit dfeea00
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions inbox/mailsync/backends/imap/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,9 @@ def condstore_refresh_flags(self, crispin_client: CrispinClient) -> None:
self.account_id, db_session, self.folder_id
)

new_uids = remote_uids.difference(local_uids)
new_uids = (
remote_uids.difference(local_uids) if self.state != "initial" else None
)
expunged_uids = local_uids.difference(remote_uids)
del local_uids # free memory as soon as possible
max_remote_uid = max(remote_uids) if remote_uids else 0
Expand Down Expand Up @@ -933,7 +935,9 @@ def refresh_flags_impl(self, crispin_client: CrispinClient, max_uids: int) -> No
self.account_id, db_session, self.folder_id
)

new_uids = remote_uids.difference(local_uids)
new_uids = (
remote_uids.difference(local_uids) if self.state != "initial" else None
)
expunged_uids = local_uids.difference(remote_uids)
del local_uids # free memory as soon as possible
del remote_uids # free memory as soon as possible
Expand Down

0 comments on commit dfeea00

Please sign in to comment.