From 33e4beacf4118e6745543504b737d6db780e3e5d Mon Sep 17 00:00:00 2001 From: thomas Date: Wed, 13 May 2020 23:12:45 -0400 Subject: [PATCH] pipeline calls to get dependency statuses --- rq/job.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rq/job.py b/rq/job.py index a97e4efb..f0f28ec3 100644 --- a/rq/job.py +++ b/rq/job.py @@ -763,11 +763,11 @@ class Job(object): if exclude_job_id: dependencies_ids.discard(exclude_job_id) - dependencies_statuses = [ - connection.hget(self.key_for(key), 'status') - for key - in dependencies_ids - ] + with connection.pipeline() as pipeline: + for key in dependencies_ids: + pipeline.hget(self.key_for(key), 'status') + + dependencies_statuses = pipeline.execute() return all( status.decode() == JobStatus.FINISHED