From 3014d44d010d915bba1b25dd1d2925c992e2a6e0 Mon Sep 17 00:00:00 2001 From: Thorsten Date: Sat, 8 Jul 2023 22:57:41 +0200 Subject: [PATCH] ack ack! --- distbot/bot/worker.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/distbot/bot/worker.py b/distbot/bot/worker.py index 05c79a3..2a3043d 100644 --- a/distbot/bot/worker.py +++ b/distbot/bot/worker.py @@ -87,12 +87,10 @@ class Worker(threading.Thread): action = self.parse_body(body) if self.uses_history: self.total_history[body["to"]].append(body) - ack = True assert (action is None) or isinstance(action, Action) except Exception as e: # Don't crash the thread. No Exceptions. - logger.exception("Ouch. {} crashed. Don't ack.".format(self.get_subclass_name()), exc_info=True) - ack = False + logger.exception("Ouch. {} crashed.".format(self.get_subclass_name()), exc_info=True) if not action: logger.debug("no action taken") else: @@ -100,9 +98,7 @@ class Worker(threading.Thread): action.recipient = action.recipient or body["to"] send_action(self.actionqueue, action) - if ack: - logger.debug("Done") - ch.basic_ack(delivery_tag=method.delivery_tag) + ch.basic_ack(delivery_tag=method.delivery_tag) def get_subclass_name(self): return self.__class__.__name__ -- 2.39.2