Let failed studio jobs retry instead of sitting in the queue with only Remove.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -84,6 +84,15 @@
|
||||
>
|
||||
{{ job.cutIn ? 'Next after current shot' : (canCutIn ? 'Run next' : 'Start now') }}
|
||||
</button>
|
||||
<button
|
||||
v-if="job.status === 'error'"
|
||||
type="button"
|
||||
class="rounded-full border border-amber-300/40 px-3 py-1.5 text-xs text-amber-100 hover:border-amber-200 disabled:cursor-not-allowed disabled:opacity-50"
|
||||
:disabled="Boolean(busyId)"
|
||||
@click="retryJob(job)"
|
||||
>
|
||||
Retry
|
||||
</button>
|
||||
<template v-if="job.shots">
|
||||
<template v-if="canProcessShots(job)">
|
||||
<button
|
||||
@@ -756,6 +765,19 @@ async function cutIn(job: StudioJobRow) {
|
||||
}
|
||||
}
|
||||
|
||||
async function retryJob(job: StudioJobRow) {
|
||||
busyId.value = job.id
|
||||
error.value = ''
|
||||
try {
|
||||
await $fetch(`/api/studio-queue/${job.id}/retry`, { method: 'POST' })
|
||||
await loadQueues()
|
||||
} catch (err: any) {
|
||||
error.value = err?.data?.statusMessage || err?.statusMessage || err?.message || 'Could not retry that job'
|
||||
} finally {
|
||||
busyId.value = ''
|
||||
}
|
||||
}
|
||||
|
||||
function listenJob(job: StudioJobRow) {
|
||||
if (!job.liveJobId || sources.has(job.id)) return
|
||||
const source = new EventSource(`/api/generate/${job.liveJobId}/stream`)
|
||||
|
||||
Reference in New Issue
Block a user