Files
SnowLuma/.pnpm-store/v11/files/52/bfab1db6430c3d8fe86cb95c6ba2aca4d3a010a212352af35616fc3720adc74e5d596597821956092a75f0ebc55adaf7681bf56dd9700b909f9172bc36f25d
TanTan 2a69b23b47
Dev Build / cleanup (push) Canceled after 0s
Dev Build / typecheck (push) Canceled after 0s
Dev Build / build (linux-arm64, ubuntu-24.04-arm, linux-arm64) (push) Canceled after 0s
Dev Build / build (linux-x64, ubuntu-latest, linux-x64) (push) Canceled after 0s
Dev Build / build (win-x64, windows-latest, win32-x64) (push) Canceled after 0s
Dev Build / dispatch-dev-docker (push) Skipped
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

13 lines
530 B
Plaintext

/** Default interval between SSE keep-alive comment frames. */
export const DEFAULT_SSE_KEEP_ALIVE_MS = 15000;
const MAX_TIMER_DELAY_MS = 2 ** 31 - 1;
/** Arms an unref'd timer, or disables keep-alive for invalid delays. */
export function armSseKeepAlive(intervalMs, onTick) {
if (!Number.isFinite(intervalMs) || intervalMs < 1) {
return undefined;
}
const timer = setInterval(onTick, Math.min(intervalMs, MAX_TIMER_DELAY_MS));
timer.unref?.();
return timer;
}
//# sourceMappingURL=sseKeepAlive.js.map