Empty the queue before deleteing the jobs, in case new jobs arrive

main
Mark Tozzi 11 years ago
parent 0713ad03c2
commit 5f6a1f0ac5

@ -65,9 +65,10 @@ class Queue(object):
def empty(self):
"""Removes all messages on the queue."""
for job in self.get_jobs():
job.cancel()
job_list = self.get_jobs()
self.connection.delete(self.key)
for job in job_list:
job.cancel()
def is_empty(self):
"""Returns whether the current queue is empty."""

Loading…
Cancel
Save