Fix: store the job result in the correct key.

And expire job hash in Redis after 500 seconds (by default).

Fixes #27.
main
Vincent Driessen 13 years ago
parent 7bda1ca969
commit 9f5b1545b6

@ -339,7 +339,7 @@ class Worker(object):
self.log.info('Job OK, result = %s' % (yellow(rv),)) self.log.info('Job OK, result = %s' % (yellow(rv),))
if rv is not None: if rv is not None:
p = conn.pipeline() p = conn.pipeline()
p.set(job.result, dumps(rv)) p.hset(job.key, 'result', dumps(rv))
p.expire(job.result, self.rv_ttl) p.expire(job.key, self.rv_ttl)
p.execute() p.execute()
return True return True

Loading…
Cancel
Save