From a77af69bf9f9d467c2ccd82fb3ecec0cb51f35f8 Mon Sep 17 00:00:00 2001 From: Simon Kelly Date: Thu, 4 Dec 2014 15:07:50 +0200 Subject: [PATCH] new style for getting redis client --- dimagi/utils/couch/cache/cache_core/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dimagi/utils/couch/cache/cache_core/__init__.py b/dimagi/utils/couch/cache/cache_core/__init__.py index 70bc21f..a98abf9 100644 --- a/dimagi/utils/couch/cache/cache_core/__init__.py +++ b/dimagi/utils/couch/cache/cache_core/__init__.py @@ -47,7 +47,11 @@ def get_redis_client(): raise RedisClientError("No redis cache defined in settings") try: - client = REDIS_CACHE.raw_client + try: + client = REDIS_CACHE.raw_client + except AttributeError: + # version >= 3.8.0 + client = REDIS_CACHE.client.get_client() except Exception: log.error("Could not get redis connection.", exc_info=True) raise RedisClientError("Could not get redis connection.")