abort queue loop when auto-process-queue is disabled
Build and Push Docker Image / build (push) Successful in 1m40s

The toggle's disable branch only wrote the config, leaving runSequential
draining indefinitely — its loop only checked signal.aborted, and the
drain re-fetch at the bottom kept pulling new pending jobs.

Add stopQueueProcessor() (mirrors stopAutoProcessLoop for the inbox
sorter) and call it from the disable branch. Current ffmpeg job runs
to completion; no new jobs start. Use POST /stop for a hard kill.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-22 07:35:09 +02:00
parent 7953d1b789
commit 0e2f027f7a
3 changed files with 17 additions and 2 deletions
+13
View File
@@ -183,6 +183,19 @@ export function maybeStartQueueProcessor(): boolean {
return true;
}
/**
* Abort the queue loop so no more jobs start after the current one. The
* currently running ffmpeg keeps going — use POST /stop to also kill it.
* Mirrors stopAutoProcessLoop() for the inbox sorter.
*/
export function stopQueueProcessor(): boolean {
if (queueAbort) {
queueAbort.abort();
return true;
}
return false;
}
/** Parse "Duration: HH:MM:SS.MS" from ffmpeg startup output. */
function parseFFmpegDuration(line: string): number | null {
const match = line.match(/Duration:\s*(\d+):(\d+):(\d+)\.(\d+)/);