Recover finished Comfy videos after relay restarts.
Persist queued jobs to disk, import leftover MP4s from Comfy history, and do not mark a run complete until the saved video exists. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+9
-1
@@ -705,7 +705,15 @@ function listen(id: string, hidden: boolean) {
|
||||
const snap = await $fetch<Record<string, any>>(`/api/generate/${id}`)
|
||||
applyJobEvent(snap, hidden)
|
||||
} catch {
|
||||
// Job snapshot can 404 briefly after a restart; keep polling while busy.
|
||||
try {
|
||||
const recovered = await $fetch<Record<string, any>>('/api/generate/recover', {
|
||||
method: 'POST',
|
||||
body: { jobId: id }
|
||||
})
|
||||
applyJobEvent(recovered, hidden)
|
||||
} catch {
|
||||
// Job snapshot can 404 briefly after a restart; keep polling while busy.
|
||||
}
|
||||
}
|
||||
}
|
||||
void tick()
|
||||
|
||||
Reference in New Issue
Block a user