]> git.aero2k.de Git - urlbot-v3.git/commitdiff
ack ack!
authorThorsten <mail@aero2k.de>
Sat, 8 Jul 2023 20:57:41 +0000 (22:57 +0200)
committerThorsten <mail@aero2k.de>
Sat, 8 Jul 2023 21:25:34 +0000 (23:25 +0200)
distbot/bot/worker.py

index 05c79a3409ceb755cb8442096a5a1b37456e1502..2a3043d72bda4c4f750ce7532b35cf8ffefe8b9e 100644 (file)
@@ -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__