mirror of https://github.com/celery/kombu.git
enhance: allow uses to disable broker heartbeats by not providing a timeout
This commit is contained in:
parent
eae75855e0
commit
cddc500fd2
|
@ -195,10 +195,11 @@ class ConsumerMixin:
|
||||||
try:
|
try:
|
||||||
conn.drain_events(timeout=safety_interval)
|
conn.drain_events(timeout=safety_interval)
|
||||||
except socket.timeout:
|
except socket.timeout:
|
||||||
conn.heartbeat_check()
|
if timeout:
|
||||||
elapsed += safety_interval
|
conn.heartbeat_check()
|
||||||
if timeout and elapsed >= timeout:
|
elapsed += safety_interval
|
||||||
raise
|
if elapsed >= timeout:
|
||||||
|
raise
|
||||||
except OSError:
|
except OSError:
|
||||||
if not self.should_stop:
|
if not self.should_stop:
|
||||||
raise
|
raise
|
||||||
|
|
Loading…
Reference in New Issue