chore: update debugging output

This commit is contained in:
Ben Allfree 2023-12-02 14:15:47 +00:00
parent b1af67b915
commit aa08397db7

View File

@ -357,17 +357,17 @@ export const instanceService = mkSingleton(
} }
{ {
tm.repeat(async () => { tm.repeat(async () => {
raw(`idle check: ${openRequestCount} open requests`) dbg(`idle check: ${openRequestCount} open requests`)
if ( if (
openRequestCount === 0 && openRequestCount === 0 &&
lastRequest + DAEMON_PB_IDLE_TTL() < now() lastRequest + DAEMON_PB_IDLE_TTL() < now()
) { ) {
dbg(`idle for ${DAEMON_PB_IDLE_TTL()}, shutting down`) info(`idle for ${DAEMON_PB_IDLE_TTL()}, shutting down`)
healthyGuard() healthyGuard()
await _safeShutdown().catch(error) await _safeShutdown().catch(error)
return false return false
} else { } else {
raw(`${openRequestCount} requests remain open`) dbg(`${openRequestCount} requests remain open`)
} }
return true return true
}, RECHECK_TTL) }, RECHECK_TTL)