Skip to content

Commit

Permalink
OpenConceptLab/ocl_issues#927 Redis clustering, fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rkorytkowski committed Jul 25, 2023
1 parent a28986a commit f909085
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,24 +309,23 @@
REDIS_SENTINELS_LIST = []

# django cache
if ENV and ENV not in ['ci']:
OPTIONS = {}
if REDIS_SENTINELS:
for REDIS_SENTINEL in REDIS_SENTINELS.split(','):
SENTINEL = REDIS_SENTINEL.split(':')
REDIS_SENTINELS_LIST.append((SENTINEL[0], int(SENTINEL[1])))
OPTIONS.update({
'CLIENT_CLASS': 'django_redis.client.SentinelClient',
'SENTINELS': REDIS_SENTINELS_LIST
})

CACHES = {
'default': {
'BACKEND': 'django_redis.cache.RedisCache',
'LOCATION': REDIS_URL,
'OPTIONS': OPTIONS
}
OPTIONS = {}
if REDIS_SENTINELS:
for REDIS_SENTINEL in REDIS_SENTINELS.split(','):
SENTINEL = REDIS_SENTINEL.split(':')
REDIS_SENTINELS_LIST.append((SENTINEL[0], int(SENTINEL[1])))
OPTIONS.update({
'CLIENT_CLASS': 'django_redis.client.SentinelClient',
'SENTINELS': REDIS_SENTINELS_LIST
})

CACHES = {
'default': {
'BACKEND': 'django_redis.cache.RedisCache',
'LOCATION': REDIS_URL,
'OPTIONS': OPTIONS
}
}

# Celery
CELERY_ENABLE_UTC = True
Expand Down

0 comments on commit f909085

Please sign in to comment.