【发布时间】:2017-12-04 13:26:32
【问题描述】:
Here 我找到了如何向 Flower 发送事件。接下来,我尝试在我的代码中使用它,例如github issue。我的版本:
@celery.task()
def add():
try:
...
except Exception as exc:
add.send_event('task-failed', exception=str(exc))
如果发生错误,Flower 会收到有关失败任务的信息:
但是当我尝试点击并查找有关它的额外信息时,我看到:
Information about failed tasks
我应该如何使用send_event?
【问题讨论】:
-
Celery 之后还会发送关于任务结果、状态的事件,此事件会重写所有之前的信息。
标签: python python-3.x celery flower