Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to know if event group {task} is enabled or disabled in Celery

Tags:

python

celery

In celery, we can enable or disable task event by:

celery control -A proj enable_events

or

celery control -A proj enable_events

When running this command from, it says - task events already enabled or task events enabled

This indicates that there's status for task - event enabled or disabled. I was wondering how to get is programmatically.

Thanks

like image 617
Krishna Sunuwar Avatar asked Feb 03 '26 18:02

Krishna Sunuwar


1 Answers

You could use the code as the following shown

app = Celery()
app.config_from_object('conf.config')

response = app.control.enable_events(reply=True)
# print response here
like image 105
Jacky1205 Avatar answered Feb 06 '26 09:02

Jacky1205



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!