Skip to content

Commit

Permalink
mailbot: support MlEmail sorting
Browse files Browse the repository at this point in the history
Every now and then some bot blasts a lot of emails at once
and we end up with the same exact dates in the defer queue.
The defer queue has tuples of data and MlEmail so when dates
are the same it tries to compare email instances. We don't
care which one gets to the start of the queue first, but
let's not crash.

Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
kuba-moo committed Jun 13, 2024
1 parent 4db9bb6 commit 289bb8e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mailbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,15 @@ def __init__(self, msg_path):
self._series_author = None
self._authorized = None

def __eq__(self, other):
return True

def __lt__(self, other):
return False

def __gt__(self, other):
return False

def get(self, item, failobj=None):
return self.msg.get(item, failobj)

Expand Down

0 comments on commit 289bb8e

Please sign in to comment.