job.cancel() should be pipelined.

main
Selwin Ong 12 years ago
parent a34d5bb303
commit e4589a4641

@ -368,12 +368,15 @@ class Job(object):
cancellation. Technically, this call is (currently) the same as just cancellation. Technically, this call is (currently) the same as just
deleting the job hash. deleting the job hash.
""" """
self.delete() pipeline = self.connection.pipeline()
self.connection.delete(self.dependents_key) self.delete(pipeline=pipeline)
pipeline.delete(self.dependents_key)
pipeline.execute()
def delete(self): def delete(self, pipeline=None):
"""Deletes the job hash from Redis.""" """Deletes the job hash from Redis."""
self.connection.delete(self.key) connection = pipeline if pipeline is not None else self.connection
connection.delete(self.key)
# Job execution # Job execution
def perform(self): # noqa def perform(self): # noqa

Loading…
Cancel
Save