mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-29 10:50:58 +00:00
10 lines
274 B
TypeScript
10 lines
274 B
TypeScript
const MAX_SAFE_TIMEOUT_MS = 2_147_483_647;
|
|
|
|
export function clampRuntimeAuthRefreshDelayMs(params: {
|
|
refreshAt: number;
|
|
now: number;
|
|
minDelayMs: number;
|
|
}): number {
|
|
return Math.min(MAX_SAFE_TIMEOUT_MS, Math.max(params.minDelayMs, params.refreshAt - params.now));
|
|
}
|