get a page of jobs

main
Alex Morega 12 years ago committed by Vincent Driessen
parent ef0f04bff6
commit e3075ea6be

@ -74,6 +74,11 @@ class Queue(object):
return None return None
return job return job
def get_jobs_page(self, offset, limit):
"""Returns a paginated list of jobs in the queue."""
job_ids = self.connection.lrange(self.key, offset, offset+limit)
return compact([self.safe_fetch_job(job_id) for job_id in job_ids])
@property @property
def job_ids(self): def job_ids(self):
"""Returns a list of all job IDS in the queue.""" """Returns a list of all job IDS in the queue."""

Loading…
Cancel
Save