auto-save 2026-05-14 02:58 (~6)

This commit is contained in:
2026-05-14 02:58:36 +08:00
parent 3ab9da094a
commit bdbaf75850
6 changed files with 95 additions and 4 deletions

View File

@@ -989,6 +989,19 @@ def get_job(job_id: str) -> Job:
return job
@app.delete("/jobs/{job_id}")
def delete_job(job_id: str) -> dict[str, bool | str]:
d = (JOBS_DIR / job_id).resolve()
if JOBS_DIR not in d.parents:
raise HTTPException(400, "invalid job id")
job = JOBS.pop(job_id, None)
if not job and not d.exists():
raise HTTPException(404, "job not found")
if d.exists():
shutil.rmtree(d)
return {"ok": True, "id": job_id}
@app.post("/jobs/{job_id}/transcribe", response_model=Job)
async def trigger_transcribe(job_id: str, bg: BackgroundTasks) -> Job:
job = JOBS.get(job_id)