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