Settings and the header menu can cancel invisible queue/pending work and force-stop Beast when Sleep is blocked. Co-authored-by: Cursor <cursoragent@cursor.com>
16 lines
546 B
TypeScript
16 lines
546 B
TypeScript
import { libraryOwnerKey } from '~/server/utils/library'
|
|
import { requestComfyForceReset } from '~/server/utils/comfyLifecycle'
|
|
import { clearStuckStudioWork } from '~/server/utils/studioQueue'
|
|
|
|
export default defineEventHandler(async (event) => {
|
|
const owner = libraryOwnerKey(event)
|
|
const cleared = await clearStuckStudioWork(owner)
|
|
const comfy = await requestComfyForceReset()
|
|
return {
|
|
ok: true,
|
|
message: 'Cleared stuck jobs and force-stopped Comfy. Use Wake / Poke when you want the GPU again.',
|
|
cleared,
|
|
comfy
|
|
}
|
|
})
|