Improving logging.

- Include worker key in worker startup log statement.
- Added a notification to make it more clear when a 'burst' worker dies.
This commit is contained in:
Trevor Prater 2015-03-27 17:45:33 -04:00
parent cff6fbff41
commit fd1dca40b9
1 changed files with 3 additions and 1 deletions

View File

@ -394,7 +394,7 @@ class Worker(object):
did_perform_work = False
self.register_birth()
self.log.info('RQ worker started, version %s' % VERSION)
self.log.info("RQ worker, '%s', started, version %s" % (self.key, VERSION))
self.set_state(WorkerStatus.STARTED)
try:
@ -410,6 +410,8 @@ class Worker(object):
result = self.dequeue_job_and_maintain_ttl(timeout)
if result is None:
if burst:
self.log.info("RQ worker, '%s', has died." % self.key)
break
except StopRequested:
break