This commit is contained in:
Timothy Jaeryang Baek
2025-07-11 17:53:53 +04:00
parent 11914d20b4
commit 788e7d0487
2 changed files with 19 additions and 24 deletions
+3 -3
View File
@@ -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}