Add Force clear for stuck queues including running YuE jobs.
Queue page and Music get a nuclear clear that cancels studio/live work, wipes shot batches, and force-stops Comfy so images/video/other music can run again. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -173,6 +173,16 @@
|
||||
/>
|
||||
{{ busy ? (status || 'Generating…') : 'Generate' }}
|
||||
</button>
|
||||
<button
|
||||
v-if="busy || queued"
|
||||
type="button"
|
||||
class="inline-flex w-full items-center justify-center rounded-2xl border border-red-400/40 px-4 py-2.5 text-sm text-red-200 hover:border-red-300 hover:text-red-100 disabled:cursor-not-allowed disabled:opacity-50"
|
||||
:disabled="forceClearing"
|
||||
title="Cancel stuck music/studio jobs and kill Comfy if wedged"
|
||||
@click="forceClearQueue"
|
||||
>
|
||||
{{ forceClearing ? 'Force clearing…' : 'Force clear stuck queue' }}
|
||||
</button>
|
||||
<p v-if="blockReason" class="text-xs text-zinc-400">{{ blockReason }}</p>
|
||||
<p v-else-if="queued" class="text-xs text-zinc-400">
|
||||
Waiting in the job queue.
|
||||
@@ -270,6 +280,7 @@ const lyricsEl = ref<HTMLTextAreaElement | null>(null)
|
||||
const ace15 = ref(false)
|
||||
const engineFamily = ref<'ace' | 'yue'>('ace')
|
||||
const busy = ref(false)
|
||||
const forceClearing = ref(false)
|
||||
const error = ref('')
|
||||
const status = ref('')
|
||||
const progress = ref(0)
|
||||
@@ -568,6 +579,34 @@ function listen(id: string) {
|
||||
}
|
||||
}
|
||||
|
||||
async function forceClearQueue() {
|
||||
if (forceClearing.value) return
|
||||
if (!confirm(
|
||||
'Force clear cancels every running and waiting job (including this track), wipes shot batches, and kills Comfy if wedged. Continue?'
|
||||
)) return
|
||||
forceClearing.value = true
|
||||
error.value = ''
|
||||
try {
|
||||
await $fetch('/api/comfy/force-reset', { method: 'POST' })
|
||||
settled = true
|
||||
busy.value = false
|
||||
queued.value = false
|
||||
progress.value = 0
|
||||
status.value = 'Queue force-cleared. Poke Comfy when you want the GPU again.'
|
||||
studioJobId.value = ''
|
||||
liveMusicId.value = ''
|
||||
jobId.value = ''
|
||||
if (source) {
|
||||
source.close()
|
||||
source = null
|
||||
}
|
||||
} catch (err: any) {
|
||||
error.value = err?.data?.statusMessage || err?.statusMessage || err?.message || 'Could not force-clear the queue'
|
||||
} finally {
|
||||
forceClearing.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function generate() {
|
||||
if (blocked.value) {
|
||||
error.value = blockReason.value
|
||||
|
||||
Reference in New Issue
Block a user