Fix issue with message suspensions

This commit is contained in:
Frisk 2024-09-15 17:01:48 +02:00
parent 3b05eea479
commit 5927c65c70

View file

@ -215,7 +215,10 @@ class MessageQueue:
logger.debug("Found webhook ID in webhook_suspensions, nuking it.")
await msg.wiki.remove_webhook_from_db(webhook_url, "Attempts to send a message to a webhook result in client error.", send_reason=False)
for message in messages:
try:
self._queue.remove(message)
except ValueError:
logger.exception("Message could not be found in the queue")
self.webhook_suspensions[webhook_id].cancel()
else:
self.webhook_suspensions[webhook_id] = asyncio.create_task(self.suspension_check(webhook_url), name="DC Sus Check for {}".format(webhook_id))