diff --git a/rq/job.py b/rq/job.py index 8fef0f3a..4cb12528 100644 --- a/rq/job.py +++ b/rq/job.py @@ -485,7 +485,8 @@ class Job: connection = pipeline if pipeline is not None else self.connection if watch and self._dependency_ids: - connection.watch(*self._dependency_ids) + connection.watch(*[self.key_for(dependency_id) + for dependency_id in self._dependency_ids]) jobs = [job for job in self.fetch_many(self._dependency_ids, connection=self.connection, serializer=self.serializer) @@ -970,7 +971,8 @@ class Job: connection = pipeline if pipeline is not None else self.connection if pipeline is not None: - connection.watch(*self.dependency_ids) + connection.watch(*[self.key_for(dependency_id) + for dependency_id in self._dependency_ids]) dependencies_ids = {_id.decode() for _id in connection.smembers(self.dependencies_key)} diff --git a/tests/test_job.py b/tests/test_job.py index 185c5ecf..fecf5bb6 100644 --- a/tests/test_job.py +++ b/tests/test_job.py @@ -998,7 +998,7 @@ class TestJob(RQTestCase): pipeline.multi() with self.assertRaises(WatchError): - self.testconn.set(dependency_job.id, 'somethingelsehappened') + self.testconn.set(Job.key_for(dependency_job.id), 'somethingelsehappened') pipeline.touch(dependency_job.id) pipeline.execute()