mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-11 20:05:19 +00:00
refac: stop task
This commit is contained in:
parent
028f29556f
commit
c0d3e70296
1 changed files with 4 additions and 1 deletions
|
|
@ -164,7 +164,10 @@ async def stop_task(redis, task_id: str):
|
||||||
# Task successfully canceled
|
# Task successfully canceled
|
||||||
return {"status": True, "message": f"Task {task_id} successfully stopped."}
|
return {"status": True, "message": f"Task {task_id} successfully stopped."}
|
||||||
|
|
||||||
return {"status": False, "message": f"Failed to stop task {task_id}."}
|
if task.cancelled() or task.done():
|
||||||
|
return {"status": True, "message": f"Task {task_id} successfully cancelled."}
|
||||||
|
|
||||||
|
return {"status": True, "message": f"Cancellation requested for {task_id}."}
|
||||||
|
|
||||||
|
|
||||||
async def stop_item_tasks(redis: Redis, item_id: str):
|
async def stop_item_tasks(redis: Redis, item_id: str):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue