mirror of https://github.com/rq/rq.git
Rename registry timeout to registry ttl
This matches job.cleanup() better and (I think) makes the purpose slightly clearer.
This commit is contained in:
parent
9f699d758d
commit
6ab7070a92
|
@ -27,9 +27,9 @@ class BaseRegistry(object):
|
|||
self.cleanup()
|
||||
return self.connection.zcard(self.key)
|
||||
|
||||
def add(self, job, timeout, pipeline=None):
|
||||
"""Adds a job to a registry with expiry time of now + timeout."""
|
||||
score = timeout if timeout < 0 else current_timestamp() + timeout
|
||||
def add(self, job, ttl, pipeline=None):
|
||||
"""Adds a job to a registry with expiry time of now + ttl."""
|
||||
score = ttl if ttl < 0 else current_timestamp() + ttl
|
||||
if pipeline is not None:
|
||||
return pipeline.zadd(self.key, score, job.id)
|
||||
|
||||
|
|
Loading…
Reference in New Issue