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.
This commit is contained in:
Nic Cope 2014-12-01 17:19:37 -05:00
parent 2091c601b1
commit 9f699d758d
1 changed files with 1 additions and 1 deletions

View File

@ -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)