Fixes cache syntax

This commit is contained in:
Mouse Reeve 2022-01-05 10:16:49 -08:00
parent 2cad762646
commit d8dbf94c29

View file

@ -120,8 +120,9 @@ STREAMS = [
] ]
# Redis cache backend # Redis cache backend
# pylint: disable=line-too-long if not env("USE_LOCAL_CACHE", False):
CACHES = { # pylint: disable=line-too-long
CACHES = {
"default": { "default": {
"BACKEND": "django_redis.cache.RedisCache", "BACKEND": "django_redis.cache.RedisCache",
"LOCATION": f"redis://:{REDIS_ACTIVITY_PASSWORD}@{REDIS_ACTIVITY_HOST}:{REDIS_ACTIVITY_PORT}/0", "LOCATION": f"redis://:{REDIS_ACTIVITY_PASSWORD}@{REDIS_ACTIVITY_HOST}:{REDIS_ACTIVITY_PORT}/0",
@ -129,13 +130,10 @@ CACHES = {
"CLIENT_CLASS": "django_redis.client.DefaultClient", "CLIENT_CLASS": "django_redis.client.DefaultClient",
}, },
} }
} }
if env("USE_LOCAL_CACHE", False):
# use the default local memory cache for testing
CACHE = None
SESSION_ENGINE = "django.contrib.sessions.backends.cache" SESSION_ENGINE = "django.contrib.sessions.backends.cache"
SESSION_CACHE_ALIAS = "default" SESSION_CACHE_ALIAS = "default"
# Database # Database
# https://docs.djangoproject.com/en/3.2/ref/settings/#databases # https://docs.djangoproject.com/en/3.2/ref/settings/#databases