Skip to content

Commit

Permalink
OpenConceptLab/ocl_issues#927 Redis clustering, fix timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
rkorytkowski committed Aug 25, 2023
1 parent ffe371b commit 53a0eed
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,10 @@
'max_retries': 10,
'interval_start': 0,
'interval_step': 1,
'interval_max': 10
'interval_max': 10,
'socket_timeout': 5.0,
'socket_connect_timeout': 5.0,
'timeout': 5.0
}

CELERY_ENABLE_UTC = True
Expand Down Expand Up @@ -389,9 +392,7 @@
CELERY_RESULT_BACKEND_BASE_SLEEP_BETWEEN_RETRIES_MS = 100
CELERY_RESULT_BACKEND_MAX_RETRIES = 10
CELERY_RESULT_BACKEND_TRANSPORT_OPTIONS = {
'retry_policy': {
'timeout': 5.0,
} | RETRY_POLICY
'retry_policy': RETRY_POLICY
}
CELERY_RESULT_EXTENDED = True
CELERY_RESULT_EXPIRES = 259200 # 72 hours
Expand All @@ -407,13 +408,11 @@
CELERY_RESULT_BACKEND = CELERY_RESULT_BACKEND[:-1] # Remove last ';'
CELERY_RESULT_BACKEND_TRANSPORT_OPTIONS.update(
{
'master_name': REDIS_SENTINELS_MASTER,
'sentinel_kwargs': REDIS_CONNECTION_OPTIONS
'master_name': REDIS_SENTINELS_MASTER
})
CELERY_BROKER_TRANSPORT_OPTIONS.update(
{
'master_name': REDIS_SENTINELS_MASTER,
'sentinel_kwargs': REDIS_CONNECTION_OPTIONS
'master_name': REDIS_SENTINELS_MASTER
})
else:
CELERY_RESULT_BACKEND = f'redis://{REDIS_HOST}:{REDIS_PORT}/{REDIS_DB}'
Expand All @@ -425,7 +424,6 @@
CELERY_BROKER_CONNECTION_RETRY_ON_STARTUP = True
CELERY_BROKER_CONNECTION_MAX_RETRIES = 10
CELERY_BROKER_CHANNEL_ERROR_RETRY = True
CELERY_BROKER_HEARTBEAT = None # Handled by Redis tcp keepalive

CELERY_TASK_PUBLISH_RETRY = True
CELERY_TASK_PUBLISH_RETRY_POLICY = {
Expand Down

0 comments on commit 53a0eed

Please sign in to comment.