From c5e62c70bb43872b49b7c4da9198c0fa052d90fb Mon Sep 17 00:00:00 2001 From: Javier Lopez Date: Tue, 3 May 2016 15:03:58 +0200 Subject: [PATCH] job.py: Use fetch to get a complete Job instance --- rq/job.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rq/job.py b/rq/job.py index 54a0f83f..b8760965 100644 --- a/rq/job.py +++ b/rq/job.py @@ -58,7 +58,7 @@ def cancel_job(job_id, connection=None): """Cancels the job with the given job ID, preventing execution. Discards any job info (i.e. it can't be requeued later). """ - Job(job_id, connection=connection).cancel() + Job.fetch(job_id, connection=connection).cancel() def requeue_job(job_id, connection=None):