From e76020d8945d6daecc31ce5f6854d819a1bb2af0 Mon Sep 17 00:00:00 2001 From: msoedov Date: Sun, 4 May 2014 15:40:12 +0300 Subject: [PATCH] Removed @resolve_connection from job decorator. -- resolve_connection already presence inside Queue __init__. --- rq/decorators.py | 3 +-- tests/test_decorator.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/rq/decorators.py b/rq/decorators.py index 169375a2..07a7a832 100644 --- a/rq/decorators.py +++ b/rq/decorators.py @@ -1,6 +1,5 @@ from functools import wraps from .queue import Queue -from .connections import resolve_connection from .worker import DEFAULT_RESULT_TTL from rq.compat import string_types @@ -28,7 +27,7 @@ class job(object): @wraps(f) def delay(*args, **kwargs): if isinstance(self.queue, string_types): - queue = Queue(name=self.queue, connection=resolve_connection(self.connection)) + queue = Queue(name=self.queue, connection=self.connection) else: queue = self.queue if 'depends_on' in kwargs: diff --git a/tests/test_decorator.py b/tests/test_decorator.py index 3c0fdd48..8af464f5 100644 --- a/tests/test_decorator.py +++ b/tests/test_decorator.py @@ -73,7 +73,7 @@ class TestDecorator(RQTestCase): self.assertEqual(bar_job._dependency_id, foo_job.id) - @mock.patch('rq.decorators.resolve_connection') + @mock.patch('rq.queue.resolve_connection') def test_decorator_connection_laziness(self, resolve_connection): """Ensure that job decorator resolve connection in `lazy` way """