feat: 去掉停止按钮,等待中的任务也能暂停

This commit is contained in:
2026-10-25 09:35:39 +08:00
parent d3e553155d
commit 2064519008
6 changed files with 63 additions and 115 deletions
-14
View File
@@ -268,20 +268,6 @@ def _remove_created(data: Path, output: Path) -> None:
shutil.rmtree(output, ignore_errors=True)
@router.post("/jobs/{job_id}/cancel")
async def cancel_job(job_id: str) -> dict:
state.require_client()
try:
job = state.jobs.get(job_id)
except NqiError as exc:
raise _bad(str(exc), 404) from exc
try:
state.jobs.request_stop(job)
except NqiError as exc:
raise _bad(str(exc)) from exc
return job.snapshot()
@router.post("/jobs/{job_id}/resume")
async def resume_job(job_id: str) -> dict:
state.require_client()