fix(api): stop serve cleanly with jobs, streams and remote sessions open

This commit is contained in:
imSp4rky
2026-11-28 21:11:50 -07:00
parent f5c8858e6e
commit 7713f8df3f
13 changed files with 222 additions and 45 deletions
+1 -1
View File
@@ -405,7 +405,7 @@ Every track carries the same fields as a local track: `is_original_lang`, `name`
Downloads are asynchronous. `POST /api/download` enqueues a job and returns immediately with a `job_id`. The server runs each job in a background job worker subprocess. You then poll the job endpoints for progress and results.
!!! info "Job states"
A job moves through `queued` → `downloading` → one of the terminal states `completed`, `failed`, or `cancelled`. You can prioritise only queued jobs. You can retry or remove only terminal jobs.
A job moves through `queued` → `downloading` → one of the terminal states `completed`, `failed`, or `cancelled`. You can prioritise only queued jobs. You can retry or remove only terminal jobs. When the server stops, it cancels each queued and downloading job and refuses a new job with `SERVER_DRAINING` (409).
### `POST /api/download`