Skip to content
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.

Commit

Permalink
Merge pull request #785 from davidk01/patch-1
Browse files Browse the repository at this point in the history
Fix issues with NoneType when shutting down
  • Loading branch information
Emmett J. Butler committed Apr 19, 2018
2 parents 17a604b + f0f267f commit 6687224
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pykafka/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,11 @@ def stop(self):
"""Stop the request processor."""
shared = self.shared
self.shared = None
log.info("RequestHandler.stop: about to flush requests queue")
shared.requests.join()
shared.ending.set()
if log:
log.info("RequestHandler.stop: about to flush requests queue")
if shared:
shared.requests.join()
shared.ending.set()

def _start_thread(self):
"""Run the request processor"""
Expand Down

0 comments on commit 6687224

Please sign in to comment.