From c832e31e20f60902ffedd8af03ee11dcbe658887 Mon Sep 17 00:00:00 2001 From: Nathan Freeman Date: Mon, 8 Jan 2024 16:21:31 -0600 Subject: [PATCH] Remove recusive calls to queue declare --- src/engine/src/core/Server.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/engine/src/core/Server.py b/src/engine/src/core/Server.py index 88a74a0f..183ad6fe 100644 --- a/src/engine/src/core/Server.py +++ b/src/engine/src/core/Server.py @@ -321,18 +321,13 @@ def _deregister_worker(self, worker, terminated=False): def _get_active_workers(self, key): return [worker for worker in self.active_workers if worker.key == key] - def _declare_queue(self, channel, queue, exclusive=True, retry_count=0, max_retries=25): - max_retries = 25 + def _declare_queue(self, channel, queue, exclusive=True): try: - logger.info(f"{lbuf('[SERVER]')} Declaring Queue '{queue}' | Attempts ({retry_count})") return channel.queue_declare(queue=queue, exclusive=exclusive) except ChannelClosedByBroker as e: - time.sleep(CONNECTION_RETRY_DELAY) - if retry_count >= max_retries: - logger.critical(f"{lbuf('[SERVER]')} Exclusive Queue Declaration Error: Maximum retry attempts reached ({MAX_CONNECTION_ATTEMPTS}) for queue {queue} | {e}") - sys.exit(1) - retry_count+=1 - self._declare_queue(channel, queue, exclusive=exclusive, retry_count=retry_count) + logger.critical(f"{lbuf('[SERVER]')} Exclusive queue declaration error for queue '{queue}' | {e}") + sys.exit(1) + def _resolve_idempotency_key(self, request): # Check the context's meta for an idempotency key. This will be used