在芹菜中,我们可以通过以下方式启用或禁用任务事件:
celery control -A proj enable_events
或
celery control -A proj enable_events
从运行此命令时,它会显示-task events already enabled
或task events enabled
这表示任务的状态为启用或禁用事件。我想知道如何以编程方式获取is。
感谢
您可以使用如下所示的代码
app = Celery()
app.config_from_object('conf.config')
response = app.control.enable_events(reply=True)
# print response here