From ddefca5cc4bba53ee6643ebe75cb7b5d58373a58 Mon Sep 17 00:00:00 2001 From: Wayne Lambert Date: Tue, 25 Aug 2020 14:42:08 +0100 Subject: [PATCH] Update timeout for Redis caching The previous commit implemented caching, however seemingly the caching expired. Updates the global `CACHES` setting to include a `TIMEOUT` setting. Contributes towards: #60 Eliminates requirement for: #41 --- aa_project/settings/dev.py | 1 + aa_project/settings/prod.py | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/aa_project/settings/dev.py b/aa_project/settings/dev.py index 83515928..788606cc 100644 --- a/aa_project/settings/dev.py +++ b/aa_project/settings/dev.py @@ -88,6 +88,7 @@ def skip_static_requests(record): 'default': { 'BACKEND': 'django_redis.cache.RedisCache', 'LOCATION': os.environ['REDIS_URL'], + 'TIMEOUT': None, 'OPTIONS': { 'CLIENT_CLASS': 'django_redis.client.DefaultClient', 'PASSWORD': os.environ['REDIS_PASSWORD'] diff --git a/aa_project/settings/prod.py b/aa_project/settings/prod.py index 30a3adb5..7bfa47de 100644 --- a/aa_project/settings/prod.py +++ b/aa_project/settings/prod.py @@ -37,12 +37,13 @@ # Django Redis Cache Settings CACHES = { - "default": { - "BACKEND": "django_redis.cache.RedisCache", - "LOCATION": os.environ['REDIS_URL'], - "OPTIONS": { - "CLIENT_CLASS": "django_redis.client.DefaultClient", - "PASSWORD": os.environ['REDIS_PASSWORD'] + 'default': { + 'BACKEND': 'django_redis.cache.RedisCache', + 'LOCATION': os.environ['REDIS_URL'], + 'TIMEOUT': None, + 'OPTIONS': { + 'CLIENT_CLASS': 'django_redis.client.DefaultClient', + 'PASSWORD': os.environ['REDIS_PASSWORD'] }, } }