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

Contains a workaround for the capitalized configuration issue #6385

Merged
merged 3 commits into from Oct 5, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 19 additions & 6 deletions celery/apps/worker.py
Expand Up @@ -141,12 +141,25 @@ def on_start(self):
app.log.redirect_stdouts(self.redirect_stdouts_level)

# TODO: Remove the following code in Celery 6.0
if app.conf.maybe_warn_deprecated_settings():
logger.warning(
"Please run `celery upgrade settings path/to/settings.py` "
"to avoid these warnings and to allow a smoother upgrade "
"to Celery 6.0."
)
# Ok this qualifies as a hack for issue #6366. Tried making it less of
bastbnl marked this conversation as resolved.
Show resolved Hide resolved
# a hack via app.__reduce_keys__(), but that may not work properly in
# all cases
warn_deprecated = True
config_source = app._config_source
if isinstance(config_source, (str, )):
bastbnl marked this conversation as resolved.
Show resolved Hide resolved
# Don't raise the warning when the settings originate from
# django.conf:settings
warn_deprecated = config_source.lower() not in [
'django.conf:settings',
]

if warn_deprecated:
if app.conf.maybe_warn_deprecated_settings():
logger.warning(
"Please run `celery upgrade settings path/to/settings.py` "
"to avoid these warnings and to allow a smoother upgrade "
"to Celery 6.0."
)

def emit_banner(self):
# Dump configuration to screen so we have some basic information
Expand Down