mirror of https://github.com/rq/rq.git
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:
parent
2091c601b1
commit
9f699d758d
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue