Fix Comfy wake: launch when HTTP is down instead of treating leftover Python as already booting.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -88,7 +88,7 @@ export async function fetchImageQueue() {
|
||||
return fetchQueueAt(getImageComfyHost())
|
||||
}
|
||||
|
||||
async function controlRequest(path: string, method = 'GET') {
|
||||
async function controlRequest(path: string, method = 'GET', timeoutMs = 5000) {
|
||||
const { controlUrl, controlToken } = settings()
|
||||
if (!controlUrl) return null
|
||||
try {
|
||||
@@ -98,7 +98,7 @@ async function controlRequest(path: string, method = 'GET') {
|
||||
Accept: 'application/json',
|
||||
...(controlToken ? { Authorization: `Bearer ${controlToken}` } : {})
|
||||
},
|
||||
signal: AbortSignal.timeout(5000)
|
||||
signal: AbortSignal.timeout(timeoutMs)
|
||||
})
|
||||
if (!res.ok) return { ok: false, status: res.status }
|
||||
return await res.json() as {
|
||||
@@ -154,7 +154,7 @@ async function startImageComfy() {
|
||||
return { started: false, reason: 'recent-start' as const }
|
||||
}
|
||||
lastStartAt = now
|
||||
const remote = await controlRequest('/start', 'POST')
|
||||
const remote = await controlRequest('/start', 'POST', 25_000)
|
||||
if (remote?.ok || remote?.started) {
|
||||
log('start-remote', { port: remote.port || null })
|
||||
return { started: true, reason: 'remote' as const }
|
||||
|
||||
Reference in New Issue
Block a user