|
|
@ -130,9 +130,13 @@ class Queue(object):
|
|
|
|
"""Returns a count of all messages in the queue."""
|
|
|
|
"""Returns a count of all messages in the queue."""
|
|
|
|
return self.connection.llen(self.key)
|
|
|
|
return self.connection.llen(self.key)
|
|
|
|
|
|
|
|
|
|
|
|
def remove(self, job_or_id):
|
|
|
|
def remove(self, job_or_id, pipeline=None):
|
|
|
|
"""Removes Job from queue, accepts either a Job instance or ID."""
|
|
|
|
"""Removes Job from queue, accepts either a Job instance or ID."""
|
|
|
|
job_id = job_or_id.id if isinstance(job_or_id, self.job_class) else job_or_id
|
|
|
|
job_id = job_or_id.id if isinstance(job_or_id, self.job_class) else job_or_id
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if pipeline is not None:
|
|
|
|
|
|
|
|
pipeline.lrem(self.key, 0, job_id)
|
|
|
|
|
|
|
|
|
|
|
|
return self.connection._lrem(self.key, 0, job_id)
|
|
|
|
return self.connection._lrem(self.key, 0, job_id)
|
|
|
|
|
|
|
|
|
|
|
|
def compact(self):
|
|
|
|
def compact(self):
|
|
|
|