M
M
m0ody2013-12-21 15:48:13
Python
m0ody, 2013-12-21 15:48:13

How to get a list of registered tasks in celery?

Colleagues, tell me how to get a list of tasks in celery. It's written in the config

CELERY_IMPORTS = ('common.background.tasks', 'st.background.tasks', )

I try like this:
from celery import current_app

>>> current_app.tasks
{'celery.chain': <@task: celery.chain of app:0x370b250>, 'celery.chord': <@task: celery.chord of app:0x370b250>, 'celery.chunks': <@task: celery.chunks of app:0x370b250>, 'celery.chord_unlock': <@task: celery.chord_unlock of app:0x370b250>, 'celery.group': <@task: celery.group of app:0x370b250>, 'celery.backend_cleanup': <@task: celery.backend_cleanup of app:0x370b250>, 'celery.map': <@task: celery.map of app:0x370b250>, 'celery.starmap': <@task: celery.starmap of app:0x370b250>}

those. my tasks are not.
There is a way to get a list of tasks through control.inspect().registered_tasks(), but there is some kind of delay when calling (speed is critical for me).

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question