From 4d7ad407a87e176f0ea01130df44054b318a0a6b Mon Sep 17 00:00:00 2001 From: Selwin Ong Date: Fri, 10 Jan 2014 15:57:14 +0700 Subject: [PATCH] Restores compatibility with django-redis >= 3.4.0. --- django_rq/queues.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/django_rq/queues.py b/django_rq/queues.py index 490f5d9a..335f6530 100644 --- a/django_rq/queues.py +++ b/django_rq/queues.py @@ -60,7 +60,13 @@ def get_redis_connection(config): # is a pluggable backend that return its Redis connection as # its `client` try: - return cache.client.client + # To get Redis connection on django-redis >= 3.4.0 + # we need to use cache.client.get_client() instead of + # cache.client.client used in older versions + try: + return cache.client.get_client() + except AttributeError: + return cache.client.client except NotImplementedError: pass else: