From 8cd1d6b283385aec0253476e3accbeed99612539 Mon Sep 17 00:00:00 2001 From: Julius Unverfehrt Date: Fri, 19 Jan 2024 14:15:00 +0100 Subject: [PATCH] add retries to queue consuming, so we retray at least a bit if something happens. Eventually the container should crash though since there do exist unfixable problems sadly. --- pyinfra/queue/manager.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pyinfra/queue/manager.py b/pyinfra/queue/manager.py index ea9c1b4..da49299 100644 --- a/pyinfra/queue/manager.py +++ b/pyinfra/queue/manager.py @@ -80,6 +80,7 @@ class QueueManager: self.establish_connection() return self.channel.is_open + @retry(exceptions=pika.exceptions.AMQPConnectionError, tries=3, delay=5, jitter=(1, 3), logger=logger) def start_consuming(self, message_processor: Callable): on_message_callback = self._make_on_message_callback(message_processor)