|
|
@ -329,6 +329,7 @@ class Queue(object):
|
|
|
|
|
|
|
|
|
|
|
|
Returns a job_class instance, which can be executed or inspected.
|
|
|
|
Returns a job_class instance, which can be executed or inspected.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
|
|
|
|
while True:
|
|
|
|
job_id = self.pop_job_id()
|
|
|
|
job_id = self.pop_job_id()
|
|
|
|
if job_id is None:
|
|
|
|
if job_id is None:
|
|
|
|
return None
|
|
|
|
return None
|
|
|
@ -336,8 +337,7 @@ class Queue(object):
|
|
|
|
job = self.job_class.fetch(job_id, connection=self.connection)
|
|
|
|
job = self.job_class.fetch(job_id, connection=self.connection)
|
|
|
|
except NoSuchJobError as e:
|
|
|
|
except NoSuchJobError as e:
|
|
|
|
# Silently pass on jobs that don't exist (anymore),
|
|
|
|
# Silently pass on jobs that don't exist (anymore),
|
|
|
|
# and continue by reinvoking itself recursively
|
|
|
|
continue
|
|
|
|
return self.dequeue()
|
|
|
|
|
|
|
|
except UnpickleError as e:
|
|
|
|
except UnpickleError as e:
|
|
|
|
# Attach queue information on the exception for improved error
|
|
|
|
# Attach queue information on the exception for improved error
|
|
|
|
# reporting
|
|
|
|
# reporting
|
|
|
|