Fix an issue where instead of new list of webhooks a reference was passed breaking broken message autoremoval

This commit is contained in:
Frisk 2025-01-20 23:36:21 +01:00
parent 2e4a5e20e1
commit c6a846fe18
2 changed files with 3 additions and 3 deletions

View file

@ -253,9 +253,9 @@ class MessageQueue:
break break
def report_lingering_messages(self): def report_lingering_messages(self):
"""Report and delete items marked as lingering for longer than 100 cycles""" """Report and delete items marked as lingering for longer than 500 cycles"""
for item in self._queue: for item in self._queue:
if item.add_linger() > 100: if item.add_linger() > 500:
item.self_destruct() item.self_destruct()
logger.error(f"Could not deliver a message! Method: {item.method}, DM: {item.discord_message.__repr__()}") logger.error(f"Could not deliver a message! Method: {item.method}, DM: {item.discord_message.__repr__()}")
return # In case there are multiple messages that linger, remove them one by one every cycle return # In case there are multiple messages that linger, remove them one by one every cycle

View file

@ -523,7 +523,7 @@ class Wiki:
if message is None: if message is None:
break break
message.wiki = self message.wiki = self
message_list.append(QueueEntry(message, webhooks, self)) message_list.append(QueueEntry(message, webhooks.copy(), self))
messagequeue.add_messages(message_list) messagequeue.add_messages(message_list)
if old_highest_id != highest_id: # update only when differs if old_highest_id != highest_id: # update only when differs
self.statistics.update(last_action=highest_id) self.statistics.update(last_action=highest_id)