fix: remove recursive call to dequeue_any

main
Jean-Christophe SAAD-DUPUY 9 years ago
parent 7312683e4d
commit 59d193590c

@ -367,6 +367,7 @@ class Queue(object):
See the documentation of cls.lpop for the interpretation of timeout.
"""
while True:
queue_keys = [q.key for q in queues]
result = cls.lpop(queue_keys, timeout, connection=connection)
if result is None:
@ -377,8 +378,8 @@ class Queue(object):
job = cls.job_class.fetch(job_id, connection=connection)
except NoSuchJobError:
# Silently pass on jobs that don't exist (anymore),
# and continue by reinvoking the same function recursively
return cls.dequeue_any(queues, timeout, connection=connection)
# and continue in the look
continue
except UnpickleError as e:
# Attach queue information on the exception for improved error
# reporting

Loading…
Cancel
Save