job.py: Fix cancel failure on failed queue

main
Javier Lopez 9 years ago
parent 636e34e55f
commit 8e24d3a92d

@ -473,11 +473,13 @@ class Job(object):
without worrying about the internals required to implement job without worrying about the internals required to implement job
cancellation. cancellation.
""" """
from .queue import Queue from .queue import Queue, get_failed_queue
pipeline = self.connection._pipeline() pipeline = self.connection._pipeline()
if self.origin: if self.origin:
queue = Queue(name=self.origin, connection=self.connection) q = (get_failed_queue(connection=self.connection)
queue.remove(self, pipeline=pipeline) if self.is_failed
else Queue(name=self.origin, connection=self.connection))
q.remove(self, pipeline=pipeline)
pipeline.execute() pipeline.execute()
def delete(self, pipeline=None, remove_from_queue=True): def delete(self, pipeline=None, remove_from_queue=True):

Loading…
Cancel
Save