Finish the current video shot list before starting the next queued video.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-08-30 07:24:47 -05:00
co-authored by Cursor
parent 61d711f989
commit 18f350c32a
5 changed files with 95 additions and 32 deletions
+5 -1
View File
@@ -320,7 +320,11 @@ export async function prepareQueueBurst(owner: string, id: string, count: number
if (activeJobs.has(queue.id)) {
throw createError({ statusCode: 409, statusMessage: 'This batch is already processing' })
}
const remaining = queue.segments.filter(segment => segment.status === 'pending' || segment.status === 'error')
const remaining = queue.segments.filter(segment => (
segment.status === 'pending'
|| segment.status === 'error'
|| (segment.status === 'running' && !activeJobs.has(queue.id))
))
if (!remaining.length) {
throw createError({ statusCode: 400, statusMessage: 'No remaining shots to process' })
}