From fd1dca40b954698680939803a232f5e1f4cecb67 Mon Sep 17 00:00:00 2001 From: Trevor Prater Date: Fri, 27 Mar 2015 17:45:33 -0400 Subject: [PATCH 1/2] Improving logging. - Include worker key in worker startup log statement. - Added a notification to make it more clear when a 'burst' worker dies. --- rq/worker.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rq/worker.py b/rq/worker.py index 41daa01..e118c3f 100644 --- a/rq/worker.py +++ b/rq/worker.py @@ -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 From 5674edad61d85bbf4dd780439ce5cbb43c40cb13 Mon Sep 17 00:00:00 2001 From: Trevor Prater Date: Sat, 28 Mar 2015 12:12:04 -0400 Subject: [PATCH 2/2] Changed rqworker shutdown message. - As requested by @nvie and @selwin. --- rq/worker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rq/worker.py b/rq/worker.py index e118c3f..a29b09b 100644 --- a/rq/worker.py +++ b/rq/worker.py @@ -411,7 +411,7 @@ 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) + self.log.info("RQ worker, '%s', done, quitting." % self.key) break except StopRequested: break