Stop cancelled video jobs from coming back after delete.

A leftover process-remaining wake was flipping the row back to running or error, so Remove looked like it did nothing.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-08-30 12:47:59 -05:00
co-authored by Cursor
parent 201eb1107f
commit c88a8494d5
5 changed files with 80 additions and 29 deletions
+7
View File
@@ -13,6 +13,7 @@ import { onLiveVideoSettled, onStudioQueueBurstStarted } from '~/server/utils/st
import {
finishQueueBurst,
getShotQueue,
isShotQueueCancelled,
lastCompletedIndex,
liveSegmentPrompt,
prepareQueueBurst,
@@ -515,6 +516,9 @@ export async function runGeneration(job: Job, params: VideoChainParams) {
}
export async function startQueueBurst(owner: string, queueId: string, count: number | 'all') {
if (isShotQueueCancelled(queueId)) {
throw createError({ statusCode: 410, statusMessage: 'This batch was removed' })
}
await ensureComfyReady((status) => {
console.log(JSON.stringify({
src: 'video-chain',
@@ -524,6 +528,9 @@ export async function startQueueBurst(owner: string, queueId: string, count: num
message: status.message
}))
})
if (isShotQueueCancelled(queueId)) {
throw createError({ statusCode: 410, statusMessage: 'This batch was removed' })
}
const { queue, count: n } = await prepareQueueBurst(owner, queueId, count)
const lastIndex = lastCompletedIndex(queue)
const clipId = queue.currentClipId