Permalink
Browse files

Moved some of the job processing logging into job and out of worker.

  • Loading branch information...
1 parent efbab62 commit e001bc8c02f385bcbddb9da90e682033653c1632 Dan Lecocq committed Apr 29, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −0 qless/job.py
  2. +0 −2 qless/worker.py
View
@@ -94,7 +94,9 @@ def process(self):
if method:
if isinstance(method, types.FunctionType):
try:
+ logger.info('Processing %s in %s' % (self.jid, self.queue))
method(self)
+ logger.info('Completed %s in %s' % (job.jid, queue.name))
except Exception as e:
# Make error type based on exception type
logger.exception('Failed %s in %s: %s' % (self.jid, self.queue, repr(method)))
View
@@ -92,10 +92,8 @@ def work(self):
job = queue.pop()
if job:
seen = True
- logger.info('Processing %s in %s' % (job.jid, queue.name))
self.setproctitle('Working %s (%s)' % (job.jid, job.klass))
job.process()
- logger.info('Completed %s in %s' % (job.jid, queue.name))
self.clean()
if not seen:

0 comments on commit e001bc8

Please sign in to comment.