gpt4 book ai didi

python - rabbitMQ 重启时 celery 撤销丢失

转载 作者:太空宇宙 更新时间:2023-11-04 06:04:30 26 4
gpt4 key购买 nike

我们正在使用 celery eta tasks 来安排 FAR(比如几个月)的任务。现在使用 rabbitMQ 后端,因为 mongo 后端在 worker 重启时确实松开了此类任务。

实际上,rabbitMQ 后端的任务似乎在 celery 和 rabbitMQ 重启后仍然存在,但是 revoke 消息似乎在 rabbitMQ 重启时丢失了。我猜如果撤销消息丢失,那些应该被杀死的 eta 任务仍然会执行。

最佳答案

这可能对文档 ( Persistent Revokes ) 有帮助:

The list of revoked tasks is in-memory so if all workers restart the list of revoked ids will also vanish. If you want to preserve this list between restarts you need to specify a file for these to be stored in by using the –statedb argument to celery worker:

$ celery -A proj worker -l info --statedb=/var/run/celery/worker.state

关于python - rabbitMQ 重启时 celery 撤销丢失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22969763/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com