log exception when thread dies (seems to be dying silently sometimes)

This commit is contained in:
Noah Levitt 2015-09-03 01:04:41 +00:00
parent 839bf6f4ae
commit 6cda4739b8

View File

@ -131,6 +131,7 @@ class BrozzlerWorker:
self._browser_pool.release(browser)
def run(self):
try:
latest_state = None
while not self._shutdown_requested.is_set():
try:
@ -154,6 +155,8 @@ class BrozzlerWorker:
self.logger.info("no unclaimed sites to browse")
latest_state = "no-unclaimed-sites"
time.sleep(0.5)
except:
self.logger.critical("thread exiting due to unexpected exception", exc_info=True)
def start(self):
th = threading.Thread(target=self.run, name="BrozzlerWorker")