Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 #5085

Open
agusmakmun opened this issue May 22, 2024 · 0 comments

Comments

@agusmakmun
Copy link

agusmakmun commented May 22, 2024

Description

I found this deprecation warning for the celery;

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.

https://docs.celeryq.dev/en/stable/userguide/configuration.html#broker-connection-retry

As the newest celery almost using that version;

{%- if cookiecutter.use_celery == "y" %}
celery==5.4.0 # pyup: < 6.0 # https://github.com/celery/celery
django-celery-beat==2.6.0 # https://github.com/celery/django-celery-beat

Solution

And found the solution at https://stackoverflow.com/a/78088996/6396981

Where we can utilize the following settings to silence the warning by putting the below code into celery.py.

celery_app.conf.broker_connection_retry_on_startup = True

or settings.py;

CELERY_BROKER_CONNECTION_RETRY_ON_STARTUP = True

Just wondering to add this into cookie-cutter-django

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant