Skip to content

Commit

Permalink
Moved some of the job processing logging into job and out of worker.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Lecocq committed Apr 29, 2012
1 parent efbab62 commit e001bc8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 2 additions & 0 deletions qless/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down
2 changes: 0 additions & 2 deletions qless/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit e001bc8

Please sign in to comment.