mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-08-15 09:24:52 +03:00
Retry when trying to store a Celery result in backend
Adds retry logic when attempting to store a Celery result in the backend. If it fails the behavior is to exponentially (from 10ms to 10s) backoff. For more context on why this was implemented see: https://github.com/celery/celery/pull/6122
This commit is contained in:
parent
e8b9253c0b
commit
33b60f5df2
|
@ -283,6 +283,11 @@ if USE_TZ:
|
||||||
CELERY_BROKER_URL = env("CELERY_BROKER_URL")
|
CELERY_BROKER_URL = env("CELERY_BROKER_URL")
|
||||||
# https://docs.celeryq.dev/en/stable/userguide/configuration.html#std:setting-result_backend
|
# https://docs.celeryq.dev/en/stable/userguide/configuration.html#std:setting-result_backend
|
||||||
CELERY_RESULT_BACKEND = CELERY_BROKER_URL
|
CELERY_RESULT_BACKEND = CELERY_BROKER_URL
|
||||||
|
# https://docs.celeryq.dev/en/stable/userguide/configuration.html#result-backend-always-retry
|
||||||
|
# https://github.com/celery/celery/pull/6122
|
||||||
|
CELERY_RESULT_BACKEND_ALWAYS_RETRY = True
|
||||||
|
# https://docs.celeryq.dev/en/stable/userguide/configuration.html#result-backend-max-retries
|
||||||
|
CELERY_RESULT_BACKEND_MAX_RETRIES = 10
|
||||||
# https://docs.celeryq.dev/en/stable/userguide/configuration.html#std:setting-accept_content
|
# https://docs.celeryq.dev/en/stable/userguide/configuration.html#std:setting-accept_content
|
||||||
CELERY_ACCEPT_CONTENT = ["json"]
|
CELERY_ACCEPT_CONTENT = ["json"]
|
||||||
# https://docs.celeryq.dev/en/stable/userguide/configuration.html#std:setting-task_serializer
|
# https://docs.celeryq.dev/en/stable/userguide/configuration.html#std:setting-task_serializer
|
||||||
|
|
Loading…
Reference in New Issue
Block a user