Clear Generating as soon as a job saves: settle the studio row on persist and repair finished orphans so the next waiting job can start.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-09-05 12:38:30 -05:00
co-authored by Cursor
parent e1bad72405
commit 8ebbc0fc6e
2 changed files with 136 additions and 109 deletions
+6
View File
@@ -363,6 +363,12 @@ export function watchComfyJob(job: Job, options: { persist?: boolean } = {}): Pr
})
deletePendingJob(job.id)
job.saving = false
// Persist path: clear the studio "Generating" row as soon as the library save
// finishes. Waiting for runGeneration's finally used to leave jobs stuck in the queue.
if (persist && job.library?.ownerKey) {
const { onLiveVideoSettled } = await import('~/server/utils/studioQueue')
await onLiveVideoSettled(job).catch(() => null)
}
} catch (saveError) {
job.saving = false
removeExtendTemp(job.library?.extendTmpDir)