How can to run task in 5 minutes after finish previous task using celery-beat?

烈酒焚心 提交于 2019-12-06 08:09:35

问题


I have a two tasks - a and b.

Task a running in 5 minutes after finish previous task a.

Task b running in 3 minutes after finish previous task b.

How can I implement it? I'm use python 3.6.8, Django 2.2.6 and celery 4.3.0?


回答1:


The short answer is that you can't do this with celery beat because celery beat will trigger off of task start and not at task end. If you absolutely need to do it three minutes after the previous task ends, you'd be advised to just adding a call to .apply_async at the end of both a and b and kicking off each task once.



来源:https://stackoverflow.com/questions/58629790/how-can-to-run-task-in-5-minutes-after-finish-previous-task-using-celery-beat

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!