set AMPQ heartbeat
This commit is contained in:
parent
9f4dfb9781
commit
301ba05d66
@ -1,3 +1,5 @@
|
||||
import logging
|
||||
|
||||
from pyinfra.queue.queue_manager.queue_manager import QueueManager
|
||||
|
||||
|
||||
@ -10,4 +12,5 @@ class Consumer:
|
||||
self.queue_manager.consume_and_publish(self.callback)
|
||||
|
||||
def consume(self, **kwargs):
|
||||
logging.info(kwargs)
|
||||
return self.queue_manager.consume(**kwargs)
|
||||
|
||||
@ -44,7 +44,12 @@ def monkey_patch_queue_handle(channel, queue) -> QueueHandle:
|
||||
def get_connection_params():
|
||||
|
||||
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)
|
||||
|
||||
return parameters
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user