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
This commit is contained in:
parent
26d6e1c977
commit
1f72ebe1b5
|
@ -30,8 +30,6 @@ LANGUAGE_CODE = "en-us"
|
||||||
SITE_ID = 1
|
SITE_ID = 1
|
||||||
# https://docs.djangoproject.com/en/dev/ref/settings/#use-i18n
|
# https://docs.djangoproject.com/en/dev/ref/settings/#use-i18n
|
||||||
USE_I18N = True
|
USE_I18N = True
|
||||||
# https://docs.djangoproject.com/en/dev/ref/settings/#use-l10n
|
|
||||||
USE_L10N = True
|
|
||||||
# https://docs.djangoproject.com/en/dev/ref/settings/#use-tz
|
# https://docs.djangoproject.com/en/dev/ref/settings/#use-tz
|
||||||
USE_TZ = True
|
USE_TZ = True
|
||||||
# https://docs.djangoproject.com/en/dev/ref/settings/#locale-paths
|
# https://docs.djangoproject.com/en/dev/ref/settings/#locale-paths
|
||||||
|
@ -285,6 +283,11 @@ CELERY_BROKER_URL = env("CELERY_BROKER_URL")
|
||||||
CELERY_RESULT_BACKEND = CELERY_BROKER_URL
|
CELERY_RESULT_BACKEND = CELERY_BROKER_URL
|
||||||
# https://docs.celeryq.dev/en/stable/userguide/configuration.html#result-extended
|
# https://docs.celeryq.dev/en/stable/userguide/configuration.html#result-extended
|
||||||
CELERY_RESULT_EXTENDED = True
|
CELERY_RESULT_EXTENDED = True
|
||||||
|
# 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
|
||||||
|
@ -299,6 +302,10 @@ CELERY_TASK_TIME_LIMIT = 5 * 60
|
||||||
CELERY_TASK_SOFT_TIME_LIMIT = 60
|
CELERY_TASK_SOFT_TIME_LIMIT = 60
|
||||||
# https://docs.celeryq.dev/en/stable/userguide/configuration.html#beat-scheduler
|
# https://docs.celeryq.dev/en/stable/userguide/configuration.html#beat-scheduler
|
||||||
CELERY_BEAT_SCHEDULER = "django_celery_beat.schedulers:DatabaseScheduler"
|
CELERY_BEAT_SCHEDULER = "django_celery_beat.schedulers:DatabaseScheduler"
|
||||||
|
# https://docs.celeryq.dev/en/stable/userguide/configuration.html#worker-send-task-events
|
||||||
|
CELERY_WORKER_SEND_TASK_EVENTS = True
|
||||||
|
# https://docs.celeryq.dev/en/stable/userguide/configuration.html#std-setting-task_send_sent_event
|
||||||
|
CELERY_TASK_SEND_SENT_EVENT = True
|
||||||
|
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
# django-allauth
|
# django-allauth
|
||||||
|
@ -348,10 +355,6 @@ SPECTACULAR_SETTINGS = {
|
||||||
"DESCRIPTION": "Documentation of API endpoints of {{ cookiecutter.project_name }}",
|
"DESCRIPTION": "Documentation of API endpoints of {{ cookiecutter.project_name }}",
|
||||||
"VERSION": "1.0.0",
|
"VERSION": "1.0.0",
|
||||||
"SERVE_PERMISSIONS": ["rest_framework.permissions.IsAdminUser"],
|
"SERVE_PERMISSIONS": ["rest_framework.permissions.IsAdminUser"],
|
||||||
"SERVERS": [
|
|
||||||
{"url": "http://127.0.0.1:8000", "description": "Local Development server"},
|
|
||||||
{"url": "https://{{ cookiecutter.domain_name }}", "description": "Production server"},
|
|
||||||
],
|
|
||||||
}
|
}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
# Your stuff...
|
# Your stuff...
|
||||||
|
|
Loading…
Reference in New Issue
Block a user