You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gpt-pilot/src/agents/runtime-auth-refresh.ts

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));
}