import { Agent, setGlobalDispatcher } from 'undici'; let initialized = false; export function initHttpKeepAlive(): void { if (initialized) return; initialized = true; setGlobalDispatcher(new Agent({ keepAliveTimeout: 30_000, keepAliveMaxTimeout: 120_000, connections: 16, pipelining: 1, })); }