Skip to content

Commit 01c50f6

Browse files
committed
Fix eager mode by updating the get_redis_connection location
Signed-off-by: tdruez <[email protected]>
1 parent 1eecd60 commit 01c50f6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dejacode/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ def enable_rq_eager_mode():
468468
This function patch the django_rq.get_redis_connection to always return a fake
469469
redis connection using the `fakeredis` library.
470470
"""
471-
import django_rq.queues
471+
from django_rq import connection_utils
472472
from fakeredis import FakeRedis
473473
from fakeredis import FakeStrictRedis
474474

@@ -478,7 +478,7 @@ def enable_rq_eager_mode():
478478
def get_fake_redis_connection(config, use_strict_redis):
479479
return FakeStrictRedis() if use_strict_redis else FakeRedis()
480480

481-
django_rq.queues.get_redis_connection = get_fake_redis_connection
481+
connection_utils.get_redis_connection = get_fake_redis_connection
482482

483483

484484
DEJACODE_ASYNC = env.bool("DEJACODE_ASYNC", default=False)

0 commit comments

Comments
 (0)