当任务运行时间长的时候,我有的时候可能想会停止这个任务进行调整,请问如何根据celery任务的id停止任务呢?
我在文档中找到了增加base=AbortableTask的方式,可以通过AsyncResult发送abort()方法,但是文档中有句话没有看懂,原文是After the result.abort() call, the task execution isn’t aborted immediately. In fact, it’s not guaranteed to abort at all. Keep checking result.state status, or call result.get(timeout=) to have it block until the task is finished.
烦请celery大神帮忙看一下,我找的地方是否正确,这句话又是指什么呢…
另外,文档中提示使用AbortableTask必须使用database backend,那么我使用redis应该是没问题的吧…