diff --git a/rq/job.py b/rq/job.py index 0661f7a..c45bb07 100644 --- a/rq/job.py +++ b/rq/job.py @@ -744,9 +744,8 @@ class Job(object): pipe = pipeline if pipeline is not None else self.connection if watch: - pipe.watch(self.dependencies_key) - pipe.watch(*[self.redis_job_namespace_prefix + as_text(_id) - for _id in pipe.smembers(self.dependencies_key)]) + pipe.watch(*[Job.key_for(_id) + for _id in self.connection.smembers(self.dependencies_key)]) sort_by = self.redis_job_namespace_prefix + '*->ended_at' get_field = self.redis_job_namespace_prefix + '*->status' @@ -762,5 +761,4 @@ class Job(object): return dependencies_statuses - _job_stack = LocalStack() diff --git a/tests/test_job.py b/tests/test_job.py index 835dc6f..e8f965a 100644 --- a/tests/test_job.py +++ b/tests/test_job.py @@ -905,29 +905,3 @@ class TestJob(RQTestCase): with self.assertRaises(WatchError): pipeline.touch(Job.key_for(dependent_job.id)) pipeline.execute() - - def test_get_dependencies_statuses_watches_dependency_set(self): - queue = Queue(connection=self.testconn) - - dependency_job = queue.enqueue(fixtures.say_hello) - dependent_job = Job.create(func=fixtures.say_hello) - dependent_job._dependency_ids = [dependency_job.id] - dependent_job.register_dependency() - - with self.testconn.pipeline() as pipeline: - - dependent_job.get_dependencies_statuses( - pipeline=pipeline, - watch=True - ) - - self.testconn.sadd( - dependent_job.dependencies_key, - queue.enqueue(fixtures.say_hello).id, - ) - - pipeline.multi() - - with self.assertRaises(WatchError): - pipeline.touch(Job.key_for(dependent_job.id)) - pipeline.execute()