move expunge to end

This commit is contained in:
Antonio J. Delgado 2024-09-05 19:10:39 +03:00
parent 2d841031eb
commit 545dab0b59

View file

@ -79,6 +79,7 @@ class RemoveDuplicateImapMessages:
self._log.error('Error, server replied: %s', unseen_data) self._log.error('Error, server replied: %s', unseen_data)
return False return False
self._process_message(message_id, data[0]) self._process_message(message_id, data[0])
self.imap.expunge()
return True return True
def _process_message(self, message_id, data): def _process_message(self, message_id, data):
@ -116,7 +117,6 @@ class RemoveDuplicateImapMessages:
self.duplicates_count += 1 self.duplicates_count += 1
else: else:
self.messages_hashes.append(msg_hash) self.messages_hashes.append(msg_hash)
self.imap.expunge()
return True return True
def connect_imap(self): def connect_imap(self):