From 289bb8e79f1d8f396bc992a3122b38e37a2a0d44 Mon Sep 17 00:00:00 2001 From: Jakub Kicinski Date: Wed, 12 Jun 2024 17:47:28 -0700 Subject: [PATCH] mailbot: support MlEmail sorting 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 --- mailbot.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mailbot.py b/mailbot.py index 0e37633..33f8058 100755 --- a/mailbot.py +++ b/mailbot.py @@ -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)