From d2eeb3b3db3dcb93f3a6108dbe1bc07e68c78d34 Mon Sep 17 00:00:00 2001 From: glaslos Date: Fri, 6 Nov 2015 11:20:41 +0100 Subject: [PATCH] job.cancel before delete and doc string fixes --- rq/job.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rq/job.py b/rq/job.py index e5e7038..d083185 100644 --- a/rq/job.py +++ b/rq/job.py @@ -467,8 +467,7 @@ class Job(object): This method merely exists as a high-level API call to cancel jobs without worrying about the internals required to implement job - cancellation. Technically, this call is (currently) the same as just - deleting the job hash. + cancellation. """ from .queue import Queue pipeline = self.connection._pipeline() @@ -478,7 +477,8 @@ class Job(object): pipeline.execute() def delete(self, pipeline=None): - """Deletes the job hash from Redis.""" + """Cancels the job and deletes the job hash from Redis.""" + self.cancel() connection = pipeline if pipeline is not None else self.connection connection.delete(self.key)