feat: 去掉停止按钮,等待中的任务也能暂停
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user