refac
This commit is contained in:
@@ -1486,7 +1486,7 @@ async def stop_task_endpoint(
|
||||
request: Request, task_id: str, user=Depends(get_verified_user)
|
||||
):
|
||||
try:
|
||||
result = await stop_task(request, task_id)
|
||||
result = await stop_task(request.app.state.redis, task_id)
|
||||
return result
|
||||
except ValueError as e:
|
||||
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=str(e))
|
||||
@@ -1494,7 +1494,7 @@ async def stop_task_endpoint(
|
||||
|
||||
@app.get("/api/tasks")
|
||||
async def list_tasks_endpoint(request: Request, user=Depends(get_verified_user)):
|
||||
return {"tasks": await list_tasks(request)}
|
||||
return {"tasks": await list_tasks(request.app.state.redis)}
|
||||
|
||||
|
||||
@app.get("/api/tasks/chat/{chat_id}")
|
||||
@@ -1505,7 +1505,7 @@ async def list_tasks_by_chat_id_endpoint(
|
||||
if chat is None or chat.user_id != user.id:
|
||||
return {"task_ids": []}
|
||||
|
||||
task_ids = await list_task_ids_by_chat_id(request, chat_id)
|
||||
task_ids = await list_task_ids_by_chat_id(request.app.state.redis, chat_id)
|
||||
|
||||
log.debug(f"Task IDs for chat {chat_id}: {task_ids}")
|
||||
return {"task_ids": task_ids}
|
||||
|
||||
Reference in New Issue
Block a user