From 7488394e313270fe7ba356c40d810e7cb3c706ee Mon Sep 17 00:00:00 2001 From: Julius Unverfehrt Date: Tue, 22 Mar 2022 15:39:39 +0100 Subject: [PATCH] add heartbeat to AMQP connection --- pyinfra/queue/queue_manager/pika_queue_manager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyinfra/queue/queue_manager/pika_queue_manager.py b/pyinfra/queue/queue_manager/pika_queue_manager.py index 75e1596..1228346 100644 --- a/pyinfra/queue/queue_manager/pika_queue_manager.py +++ b/pyinfra/queue/queue_manager/pika_queue_manager.py @@ -45,7 +45,7 @@ def get_connection(): credentials = pika.PlainCredentials(username=CONFIG.rabbitmq.user, password=CONFIG.rabbitmq.password) - kwargs = {"host": CONFIG.rabbitmq.host, "port": CONFIG.rabbitmq.port, "credentials": credentials} + kwargs = {"host": CONFIG.rabbitmq.host, "port": CONFIG.rabbitmq.port, "credentials": credentials, "heartbeat": CONFIG.rabbitmq.heartbeat} parameters = pika.ConnectionParameters(**kwargs) @@ -96,7 +96,7 @@ class PikaQueueManager(QueueManager): def publish_response(self, message, callback, max_attempts=3): - logger.debug(f"Publishing response for {message}.") + logger.debug(f"Processing {message}.") frame, properties, body = message