mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-16 20:07:49 +01:00
refac: stop task
This commit is contained in:
@@ -164,7 +164,10 @@ async def stop_task(redis, task_id: str):
|
||||
# Task successfully canceled
|
||||
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):
|
||||
|
||||
Reference in New Issue
Block a user