From 9f699d758d125a2e8b0b3f962039643ac6793e27 Mon Sep 17 00:00:00 2001 From: Nic Cope Date: Mon, 1 Dec 2014 17:19:37 -0500 Subject: [PATCH] Any negative number should cause a job to live forever in a registry. While the documentation explicitly mentions ttl=-1, this matches better the behaviour of the job.cleanup() method. --- rq/registry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rq/registry.py b/rq/registry.py index a1b89b2..c620eb9 100644 --- a/rq/registry.py +++ b/rq/registry.py @@ -29,7 +29,7 @@ class BaseRegistry(object): def add(self, job, timeout, pipeline=None): """Adds a job to a registry with expiry time of now + timeout.""" - score = timeout if timeout == -1 else current_timestamp() + timeout + score = timeout if timeout < 0 else current_timestamp() + timeout if pipeline is not None: return pipeline.zadd(self.key, score, job.id)