update timings
Browse files
worker.py
CHANGED
|
@@ -24,8 +24,8 @@ class RabbitMQWorker:
|
|
| 24 |
def setup_publisher(self):
|
| 25 |
if not self.publisher_connection or self.publisher_connection.is_closed:
|
| 26 |
connection_params = pika.URLParameters(self.rabbit_url)
|
| 27 |
-
connection_params.heartbeat =
|
| 28 |
-
connection_params.blocked_connection_timeout =
|
| 29 |
|
| 30 |
self.publisher_connection = pika.BlockingConnection(connection_params)
|
| 31 |
self.publisher_channel = self.publisher_connection.channel()
|
|
@@ -111,8 +111,8 @@ class RabbitMQWorker:
|
|
| 111 |
def connect_to_rabbitmq(self):
|
| 112 |
"""Establish connection to RabbitMQ with heartbeat"""
|
| 113 |
connection_params = pika.URLParameters(self.rabbit_url)
|
| 114 |
-
connection_params.heartbeat =
|
| 115 |
-
connection_params.blocked_connection_timeout =
|
| 116 |
|
| 117 |
connection = pika.BlockingConnection(connection_params)
|
| 118 |
channel = connection.channel()
|
|
|
|
| 24 |
def setup_publisher(self):
|
| 25 |
if not self.publisher_connection or self.publisher_connection.is_closed:
|
| 26 |
connection_params = pika.URLParameters(self.rabbit_url)
|
| 27 |
+
connection_params.heartbeat = 1000 # Match the consumer heartbeat
|
| 28 |
+
connection_params.blocked_connection_timeout = 500 # Increase timeout
|
| 29 |
|
| 30 |
self.publisher_connection = pika.BlockingConnection(connection_params)
|
| 31 |
self.publisher_channel = self.publisher_connection.channel()
|
|
|
|
| 111 |
def connect_to_rabbitmq(self):
|
| 112 |
"""Establish connection to RabbitMQ with heartbeat"""
|
| 113 |
connection_params = pika.URLParameters(self.rabbit_url)
|
| 114 |
+
connection_params.heartbeat = 1000
|
| 115 |
+
connection_params.blocked_connection_timeout = 500
|
| 116 |
|
| 117 |
connection = pika.BlockingConnection(connection_params)
|
| 118 |
channel = connection.channel()
|