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:
@@ -1167,6 +1167,14 @@
|
||||
>
|
||||
{{ job.cutIn ? 'Next' : (canCutInStudioJob ? 'Run next' : 'Start now') }}
|
||||
</button>
|
||||
<button
|
||||
v-if="job.status === 'error' || (job.status === 'held' && !job.holdForCutIn)"
|
||||
type="button"
|
||||
class="shrink-0 rounded-full border border-amber-300/40 px-2.5 py-1 text-xs text-amber-100 hover:border-amber-200 hover:text-white"
|
||||
@click="retryStudioJob(job.id)"
|
||||
>
|
||||
Retry
|
||||
</button>
|
||||
<button
|
||||
v-if="job.status === 'waiting' || job.status === 'held' || job.status === 'running' || job.status === 'error'"
|
||||
type="button"
|
||||
@@ -5085,6 +5093,16 @@ async function cutInStudioJob(id: string) {
|
||||
}
|
||||
}
|
||||
|
||||
async function retryStudioJob(id: string) {
|
||||
try {
|
||||
await $fetch(`/api/studio-queue/${id}/retry`, { method: 'POST' })
|
||||
toast('Queued to run as soon as the GPU is free.')
|
||||
await refreshStudioQueue()
|
||||
} catch (error: any) {
|
||||
toast(error?.data?.statusMessage || error?.statusMessage || 'Could not retry that job')
|
||||
}
|
||||
}
|
||||
|
||||
async function dismissStudioJob(id: string) {
|
||||
try {
|
||||
await $fetch(`/api/studio-queue/${id}`, { method: 'DELETE' })
|
||||
|
||||
@@ -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