feat: 增加失败任务重试与 CUDA 动态库路径注入

This commit is contained in:
cat-shark
2026-08-13 22:01:42 +08:00
parent a8d11eafc6
commit 77e9ac6b7e
8 changed files with 345 additions and 4 deletions
+11
View File
@@ -100,6 +100,17 @@ def get_run(run_id: str, db: Database = Depends(_get_db)) -> dict:
return run
@router.post("/api/runs/{run_id}/retry")
def retry_run(run_id: str, db: Database = Depends(_get_db)) -> dict:
run = db.get_run(run_id)
if run is None:
raise HTTPException(status_code=404, detail="run not found")
if run["status"] != "FAILED":
raise HTTPException(status_code=422, detail="only failed runs can be retried")
db.reset_run(run_id, _now_iso())
return {"id": run_id, "status": "QUEUED"}
@router.get("/api/runs/{run_id}/artifacts")
def list_run_artifacts(run_id: str, db: Database = Depends(_get_db)) -> list[dict]:
if db.get_run(run_id) is None: