Files
aigen/server/api/health.get.ts
T
TowstyandCursor a7a810a7b3 Let clips move between folders, save busy jobs, and fail dropped Comfy runs.
Held jobs restore the form after a 3-minute wait, hidden stills stay blurred in the picker, and reloading Comfy no longer leaves xaigen spinning.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-25 21:46:24 -05:00

22 lines
614 B
TypeScript

import { checkComfyHttp, fetchQueue } from '~/server/utils/comfyLifecycle'
export default defineEventHandler(async () => {
const [comfy, queue] = await Promise.all([
checkComfyHttp().catch(() => ({ ok: false, host: '', stats: null })),
fetchQueue()
])
const busy = Boolean(comfy.ok && queue.running > 0)
return {
ok: true,
service: useRuntimeConfig().public.instanceName || 'aigen',
comfy: {
ok: comfy.ok,
busy,
host: comfy.host || '',
queueRunning: queue.running,
queuePending: queue.pending,
stats: comfy.ok ? comfy.stats : undefined
}
}
})