Do not mark Beast offline when /system_stats times out during a render.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -51,7 +51,7 @@ function settings() {
|
||||
}
|
||||
}
|
||||
|
||||
export async function checkImageComfyHttp(timeoutMs = 2500, host?: string) {
|
||||
export async function checkImageComfyHttp(timeoutMs = 5000, host?: string) {
|
||||
let resolved = host || ''
|
||||
try {
|
||||
if (!resolved) {
|
||||
@@ -69,17 +69,18 @@ export async function checkImageComfyHttp(timeoutMs = 2500, host?: string) {
|
||||
}
|
||||
|
||||
export async function fetchQueueAt(host: string) {
|
||||
if (!host) return { running: 0, pending: 0 }
|
||||
if (!host) return { running: 0, pending: 0, ok: false }
|
||||
try {
|
||||
const res = await fetch(`${host}/queue`, { signal: AbortSignal.timeout(2500) })
|
||||
if (!res.ok) return { running: 0, pending: 0 }
|
||||
const res = await fetch(`${host}/queue`, { signal: AbortSignal.timeout(5000) })
|
||||
if (!res.ok) return { running: 0, pending: 0, ok: false }
|
||||
const payload = await res.json() as { queue_running?: unknown[]; queue_pending?: unknown[] }
|
||||
return {
|
||||
running: Array.isArray(payload.queue_running) ? payload.queue_running.length : 0,
|
||||
pending: Array.isArray(payload.queue_pending) ? payload.queue_pending.length : 0
|
||||
pending: Array.isArray(payload.queue_pending) ? payload.queue_pending.length : 0,
|
||||
ok: true
|
||||
}
|
||||
} catch {
|
||||
return { running: 0, pending: 0 }
|
||||
return { running: 0, pending: 0, ok: false }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user