-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Open
Description
Checklist
- I have checked the issues list
for similar or identical bug reports. - I have checked the pull requests list
for existing proposed fixes. - I have checked the commit log
to find out if the bug was already fixed in the main branch. - I have included all related issues and possible duplicate issues in this issue
(If there are none, check this box anyway).
Related Issues and Possible Duplicates
Related Issues
- None
Possible Duplicates
- None
Description
https://docs.celeryq.dev/en/latest/userguide/signals.html#user-preload-options refers to celery.bin.base.Option which doesn't exist. There's CeleryOption, but that has a different API, the param_decls should be a sequence of str, not a plain str.
Suggestions
from celery import Celery
from celery import signals
from click import option
app = Celery()
app.user_options['preload'].add(option(
'--monitoring', action='store_true',
help='Enable our external monitoring utility, blahblah',
))
@signals.user_preload_options.connect
def handle_preload_options(options, **kwargs):
if options['monitoring']:
enable_monitoring()