From 8a0f4740753e1e3efd6e7150e627d537531acd79 Mon Sep 17 00:00:00 2001 From: Roberto Soto Date: Sat, 2 Nov 2019 20:00:43 -0700 Subject: [PATCH] use AMQP heartbeat feature --- python_apps/pypo/pypo/pypomessagehandler.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python_apps/pypo/pypo/pypomessagehandler.py b/python_apps/pypo/pypo/pypomessagehandler.py index 04b1a6a75..5582be086 100644 --- a/python_apps/pypo/pypo/pypomessagehandler.py +++ b/python_apps/pypo/pypo/pypomessagehandler.py @@ -48,8 +48,9 @@ class PypoMessageHandler(Thread): schedule_queue = Queue("pypo-fetch", exchange=schedule_exchange, key="foo") with Connection(self.config["host"], \ self.config["user"], \ - self.config["password"],\ - self.config["vhost"]) as connection: + self.config["password"], \ + self.config["vhost"], \ + hearbeat = 4) as connection: rabbit = RabbitConsumer(connection, [schedule_queue], self) rabbit.run() except Exception, e: