Add more check conditions for unhealthy workers and make the messaging better.

This commit is contained in:
Joseph Schorr 2014-08-26 12:41:43 -04:00
parent 67905c277e
commit 510bbe7889
2 changed files with 7 additions and 5 deletions

View file

@ -135,8 +135,8 @@ class Worker(object):
except WorkerUnhealthyException:
logger.error('The worker has encountered an error and will not take new jobs. Job is being requeued.')
self._stop.set()
self.mark_current_incomplete(restore_retry=True)
self._stop.set()
finally:
# Close the db handle periodically