From aefa44b30c2d2a4103523afb9f59317e0386f68a Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Mon, 2 Sep 2013 23:48:34 +0200 Subject: [PATCH] Store birth and death values as UTC dates. --- rq/worker.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/rq/worker.py b/rq/worker.py index 64f6501..aec17dc 100644 --- a/rq/worker.py +++ b/rq/worker.py @@ -195,11 +195,10 @@ class Worker(object): raise ValueError('There exists an active worker named \'%s\' ' 'already.' % (self.name,)) key = self.key - now = time.time() queues = ','.join(self.queue_names()) with self.connection._pipeline() as p: p.delete(key) - p.hset(key, 'birth', now) + p.hset(key, 'birth', times.format(times.now(), 'UTC')) p.hset(key, 'queues', queues) p.sadd(self.redis_workers_keys, key) p.expire(key, self.default_worker_ttl) @@ -212,7 +211,7 @@ class Worker(object): # We cannot use self.state = 'dead' here, because that would # rollback the pipeline p.srem(self.redis_workers_keys, self.key) - p.hset(self.key, 'death', time.time()) + p.hset(self.key, 'death', times.format(times.now(), 'UTC')) p.expire(self.key, 60) p.execute()