diff --git a/apps/api/app/api/routes/gpu_lipsync.py b/apps/api/app/api/routes/gpu_lipsync.py index db3a83821..da1b8385f 100644 --- a/apps/api/app/api/routes/gpu_lipsync.py +++ b/apps/api/app/api/routes/gpu_lipsync.py @@ -184,13 +184,16 @@ async def report_result( pass # 其他情况:success=true 且无文件 → Worker 已自行 PUT 到预签名 URL,直接标记完成 - task = svc.report_result( - task_id=task_id, - worker_id=worker_id, - success=success, - duration_seconds=duration_seconds, - error_msg=error_msg, - ) + try: + task = svc.report_result( + task_id=task_id, + worker_id=worker_id, + success=success, + duration_seconds=duration_seconds, + error_msg=error_msg, + ) + except KeyError as exc: + raise HTTPException(status_code=404, detail=str(exc)) from exc return GpuLipsyncResultResponse( ok=True, task_id=task.id,