Cosmetic changes to the command line output.

main
Vincent Driessen 13 years ago
parent e4055ca42f
commit bd08f24f15

@ -21,6 +21,7 @@ from .exceptions import NoQueueError, UnpickleError
green = make_colorizer('darkgreen') green = make_colorizer('darkgreen')
yellow = make_colorizer('darkyellow') yellow = make_colorizer('darkyellow')
red = make_colorizer('darkred')
blue = make_colorizer('darkblue') blue = make_colorizer('darkblue')
@ -328,8 +329,8 @@ class Worker(object):
rv = job.perform() rv = job.perform()
except Exception as e: except Exception as e:
fq = self.failed_queue fq = self.failed_queue
self.log.exception(e) self.log.exception(red(str(e)))
self.log.warning('Moving job to %s queue.' % (fq.name,)) self.log.warning('Moving job to %s queue.' % fq.name)
# Store the exception information... # Store the exception information...
job.ended_at = times.now() job.ended_at = times.now()
@ -341,7 +342,7 @@ class Worker(object):
if rv is None: if rv is None:
self.log.info('Job OK') self.log.info('Job OK')
else: else:
self.log.info('Job OK, result = %s' % (yellow(rv),)) self.log.info('Job OK, result = %s' % (yellow(unicode(rv)),))
if rv is not None: if rv is not None:
p = conn.pipeline() p = conn.pipeline()
p.hset(job.key, 'result', dumps(rv)) p.hset(job.key, 'result', dumps(rv))

Loading…
Cancel
Save