From 380c41400b535447839e5552df2410af35a75280 Mon Sep 17 00:00:00 2001 From: Peter Pfeufer Date: Fri, 15 Sep 2023 11:42:47 +0200 Subject: [PATCH] [CHANGE] Updating `celery.py` to prevent deprecation warning ``` [2023-08-14 06:41:04,904: WARNING/MainProcess] /mnt/sda1/Development/Python/AllianceAuth/venv-3.11/lib/python3.11/site-packages/celery/worker/consumer/consumer.py:498: CPendingDeprecationWarning: The broker_connection_retry configuration setting will no longer determine whether broker connection retries are made during startup in Celery 6.0 and above. If you wish to retain the existing behavior for retrying connections on startup, you should set broker_connection_retry_on_startup to True. ``` --- allianceauth/project_template/project_name/celery.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/allianceauth/project_template/project_name/celery.py b/allianceauth/project_template/project_name/celery.py index c55a67d0..35ec18dd 100644 --- a/allianceauth/project_template/project_name/celery.py +++ b/allianceauth/project_template/project_name/celery.py @@ -13,6 +13,10 @@ app = Celery('{{ project_name }}') # the configuration object to child processes. app.config_from_object('django.conf:settings') +# Automatically try to establish the connection to the AMQP broker on +# Celery startup if it is unavailable. +app.conf.broker_connection_retry_on_startup = True + # setup priorities ( 0 Highest, 9 Lowest ) app.conf.broker_transport_options = { 'priority_steps': list(range(10)), # setup que to have 10 steps