From 72a0644086a9b1a2c129e8d09b9f2891d13d6aa7 Mon Sep 17 00:00:00 2001 From: "Dustin J. Mitchell" Date: Mon, 13 Jan 2014 10:17:56 -0500 Subject: [PATCH] move heartbeat check to only occur on timeouts --- kombu/mixins.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kombu/mixins.py b/kombu/mixins.py index 8d962d05..081ae580 100644 --- a/kombu/mixins.py +++ b/kombu/mixins.py @@ -188,11 +188,11 @@ class ConsumerMixin(object): for i in limit and range(limit) or count(): if self.should_stop: break - conn.heartbeat_check() self.on_iteration() try: conn.drain_events(timeout=safety_interval) except socket.timeout: + conn.heartbeat_check() elapsed += safety_interval if timeout and elapsed >= timeout: raise