F4: verify task recovery and document Prompt background jobs
This commit is contained in:
@@ -66,3 +66,13 @@ async def send_input(task_id: str, body: TaskInput):
|
||||
raise HTTPException(400, str(exc)) from exc
|
||||
except Exception as exc:
|
||||
raise HTTPException(502, "远端暂未接受回复,请稍后重试") from exc
|
||||
|
||||
|
||||
@router.post("/{task_id}/refresh")
|
||||
async def refresh_task(task_id: str):
|
||||
try:
|
||||
return await task_service.reconcile(task_id)
|
||||
except ValueError as exc:
|
||||
raise HTTPException(404, str(exc)) from exc
|
||||
except Exception as exc:
|
||||
raise HTTPException(502, "暂时无法核查远端状态") from exc
|
||||
|
||||
Reference in New Issue
Block a user