From c2aa435869929c0f7c18e72955213464bead9822 Mon Sep 17 00:00:00 2001 From: Anuj Mathur Date: Thu, 13 Mar 2014 12:17:18 +0530 Subject: [PATCH] Added logging on RabbitMQ connection error and revival --- worker/worker.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/worker/worker.py b/worker/worker.py index 4fe2dd5..ae6fbaa 100644 --- a/worker/worker.py +++ b/worker/worker.py @@ -143,6 +143,13 @@ class Consumer(kombu.mixins.ConsumerMixin): self.should_stop = True shutdown_soon = True + def on_connection_revived(self): + _get_child_logger().debug("The connection to RabbitMQ was revived.") + + def on_connection_error(self, exc, interval): + _get_child_logger().error("RabbitMQ Broker connection error: %r. " + "Trying again in %s seconds.", exc, interval) + def continue_running(): return not shutdown_soon