mirror of https://github.com/rq/rq.git
Replaced limit by length and start by offset
Replaced limit by length and start by offset to remove a possible ambiguity
This commit is contained in:
parent
d23963a973
commit
5cfbae61a9
12
rq/queue.py
12
rq/queue.py
|
@ -74,17 +74,17 @@ class Queue(object):
|
|||
return None
|
||||
return job
|
||||
|
||||
def get_job_ids(self, start=0, limit=-1):
|
||||
def get_job_ids(self, offset=0, length=-1):
|
||||
"""Returns a slice of job IDs in the queue."""
|
||||
if limit >= 0:
|
||||
end = start + limit
|
||||
if length >= 0:
|
||||
end = start + length
|
||||
else:
|
||||
end = limit
|
||||
end = lenth
|
||||
return self.connection.lrange(self.key, start, end)
|
||||
|
||||
def get_jobs(self, start=0, limit=-1):
|
||||
def get_jobs(self, offset=0, length=-1):
|
||||
"""Returns a slice of jobs in the queue."""
|
||||
job_ids = self.get_job_ids(start, limit)
|
||||
job_ids = self.get_job_ids(start, length)
|
||||
return compact([self.safe_fetch_job(job_id) for job_id in job_ids])
|
||||
|
||||
@property
|
||||
|
|
Loading…
Reference in New Issue