Commit 07ad5b24 authored by Federico Sismondi's avatar Federico Sismondi

increased connection timeout for AMQP connection

parent 73e7cbdf
...@@ -14,6 +14,7 @@ from kombu.mixins import ConsumerMixin ...@@ -14,6 +14,7 @@ from kombu.mixins import ConsumerMixin
class BaseConsumer(ConsumerMixin): class BaseConsumer(ConsumerMixin):
DEFAULT_EXCHANGE_NAME = "amq.topic" DEFAULT_EXCHANGE_NAME = "amq.topic"
AMQP_CONNECTION_TIMEOUT = 10
def __init__(self, user, password, session, server, exchange, name, consumer_name, topics): def __init__(self, user, password, session, server, exchange, name, consumer_name, topics):
""" """
...@@ -42,7 +43,8 @@ class BaseConsumer(ConsumerMixin): ...@@ -42,7 +43,8 @@ class BaseConsumer(ConsumerMixin):
session=session, session=session,
server=server) server=server)
self.connection = Connection(self.server_url, self.connection = Connection(self.server_url,
transport_options={'confirm_publish': True}) transport_options={'confirm_publish': True},
connect_timeout=self.AMQP_CONNECTION_TIMEOUT)
if exchange: if exchange:
self.exchange = Exchange(exchange, self.exchange = Exchange(exchange,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment