From: Thorsten Date: Sat, 8 Jul 2023 20:57:41 +0000 (+0200) Subject: ack ack! X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=3014d44d010d915bba1b25dd1d2925c992e2a6e0;p=urlbot-v3.git ack ack! --- 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__