Skip to content

Commit

Permalink
always send worker_shutdown signal
Browse files Browse the repository at this point in the history
  • Loading branch information
cenkalti committed Nov 8, 2019
1 parent f5de280 commit 9d43a83
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kuyruk/worker.py
Expand Up @@ -106,12 +106,13 @@ def run(self) -> None:
try:
signals.worker_start.send(self.kuyruk, worker=self)
self._consume_messages()
signals.worker_shutdown.send(self.kuyruk, worker=self)
finally:
self.shutdown_pending.set()
for t in self._threads:
t.join()

signals.worker_shutdown.send(self.kuyruk, worker=self)

logger.debug("End run worker")

def _consume_messages(self) -> None:
Expand Down

0 comments on commit 9d43a83

Please sign in to comment.