Django rest framework 按任务id强制停止huey进行中任务
有人知道如何仅使用任务id强制停止正在进行的Huey任务吗?我尝试执行以下操作,但无效:Django rest framework 按任务id强制停止huey进行中任务,django-rest-framework,python-huey,Django Rest Framework,Python Huey,有人知道如何仅使用任务id强制停止正在进行的Huey任务吗?我尝试执行以下操作,但无效: # define a simple task import time from huey.contrib.djhuey import task @task() def test(): time.sleep(100) return 'test' # run task task_output = test() # revoke task by task id from huey.contr
# define a simple task
import time
from huey.contrib.djhuey import task
@task()
def test():
time.sleep(100)
return 'test'
# run task
task_output = test()
# revoke task by task id
from huey.contrib.djhuey import HUEY
HUEY.revoke_by_id(task_output.id)
它没有显示错误消息,只是不起作用。谁知道我做错了什么?有没有关于如何迫使任务停止的建议