Skip to content

Commit

Permalink
Changing env var from REDIS_CACHE_URL to REDIS_URL to work better wit…
Browse files Browse the repository at this point in the history
…h heroku
  • Loading branch information
moz-astults committed Aug 9, 2021
1 parent 2fccfb3 commit 8248225
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions privaterelay/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,12 @@ def _get_initial_middleware():
)
}

REDIS_CACHE_URL = config('REDIS_CACHE_URL', '', cast=str)
if REDIS_CACHE_URL:
REDIS_URL = config('REDIS_URL', '', cast=str)
if REDIS_URL:
CACHES = {
"default": {
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": REDIS_CACHE_URL,
"LOCATION": REDIS_URL,
"OPTIONS": {
"CLIENT_CLASS": "django_redis.client.DefaultClient",
}
Expand All @@ -268,12 +268,6 @@ def _get_initial_middleware():
SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
SESSION_CACHE_ALIAS = 'default'

# When running on heroku we need to ignore invalid TLS certs
# https://devcenter.heroku.com/articles/heroku-redis#connecting-in-django
if ON_HEROKU:
CACHES['default']['OPTIONS']['CONNECTION_POOL_KWARGS'] = {"ssl_cert_reqs": None}


# Password validation
# https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators

Expand Down

0 comments on commit 8248225

Please sign in to comment.