diff --git a/docker/conf/celery.py b/docker/conf/celery.py index 6d0c5a8e..6a386526 100644 --- a/docker/conf/celery.py +++ b/docker/conf/celery.py @@ -14,6 +14,10 @@ app = Celery('myauth') # Celery startup if it is unavailable. app.conf.broker_connection_retry_on_startup = True +# Set a hard task execution time of 5 minutes before celery will cold restart +app.conf.worker_soft_shutdown_timeout = 300 +app.conf.worker_enable_soft_shutdown_on_idle = True + # Using a string here means the worker don't have to serialize # the configuration object to child processes. app.config_from_object('django.conf:settings') diff --git a/pyproject.toml b/pyproject.toml index 3e91e70c..2fd29ad7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,7 +40,7 @@ dynamic = [ dependencies = [ "bcrypt", "beautifulsoup4", - "celery>=5.4,<6", + "celery>=5.5,<6", "celery-once>=3.0.1", "django>=5.1,<5.2", "django-bootstrap-form",