From 6721463fdfa4553ae30e825dadf44b3c30e02895 Mon Sep 17 00:00:00 2001 From: Selwin Ong Date: Tue, 6 Dec 2016 08:45:06 +0700 Subject: [PATCH] queue.enqueue_call should call Job.exists with connection parameters. --- rq/queue.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rq/queue.py b/rq/queue.py index edd9380..e9772f1 100644 --- a/rq/queue.py +++ b/rq/queue.py @@ -206,10 +206,10 @@ class Queue(object): try: pipe.watch(depends_on.key) - # If the dependency does not exist, we raise an - # exception. So the caller is able to avoid an orphaned - # job. - if not self.job_class.exists(depends_on.id): + # If the dependency does not exist, raise an + # exception to avoid creating an orphaned job. + if not self.job_class.exists(depends_on.id, + self.connection): raise InvalidJobDependency('Job {0} does not exist'.format(depends_on.id)) if depends_on.get_status() != JobStatus.FINISHED: