Files
openclaw/src/utils/timer-delay.ts
Peter Steinberger 85beee613c docs: clarify inline code comments
Comment-only follow-up documenting reusable gateway, auth, proxy, device, Talk, session, and agent helper contracts.\n\nVerification: git diff --check plus targeted tests recorded in PR body.
2026-05-31 14:37:41 +01:00

18 lines
571 B
TypeScript

import { resolveSafeTimeoutDelayMs } from "../../packages/gateway-client/src/timeouts.js";
export {
addSafeTimeoutDelayGraceMs,
MAX_SAFE_TIMEOUT_DELAY_MS,
resolveFiniteTimeoutDelayMs,
resolveSafeTimeoutDelayMs,
} from "../../packages/gateway-client/src/timeouts.js";
/** Wrapper around setTimeout that clamps unsafe or invalid delays before arming the timer. */
export function setSafeTimeout(
callback: () => void,
delayMs: number,
opts?: { minMs?: number },
): NodeJS.Timeout {
return setTimeout(callback, resolveSafeTimeoutDelayMs(delayMs, opts));
}