Is there a way to get a list of registered tasks?
I tried:
celery_app.tasks.keys()
Which only returns built in Celery tasks like celery.chord, celery.chain etc.
Is there a way to get a list of registered tasks?
I tried:
celery_app.tasks.keys()
Which only returns built in Celery tasks like celery.chord, celery.chain etc.
This will give a dictionary of all workers & related registered tasks.
In case if you have multiple workers running same tasks or if you just need a set of all registered tasks, it does the job.
Alternate Way:
From terminal you can get a dump of registered tasks by using this command
To inspect tasks related to a specific app, you can pass app name
With the newer versions of celery ( 4.0 and above ), the following seems to be the right way:
In a shell, try:
current_app.tasks
has all tasks available as a dictionary. The keys are all the names of registered tasks in the current celery app you are running.