Skip to content

Commit

Permalink
do not block on heartbeat thread
Browse files Browse the repository at this point in the history
  • Loading branch information
cenkalti committed Mar 9, 2018
1 parent c32b883 commit 4dfde9c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kuyruk/heartbeat.py
Expand Up @@ -27,10 +27,10 @@ def stop(self) -> None:
self._thread.join()

def _run(self) -> None:
while not self._stop.is_set():
while not self._stop.wait(timeout=1):
try:
self._connection.heartbeat_tick()
self._connection.drain_events(timeout=1)
self._connection.drain_events(timeout=0)
except socket.timeout:
pass
except Exception as e:
Expand Down

0 comments on commit 4dfde9c

Please sign in to comment.