Files
PaperClipAI/server/src/oauth/backoff.ts
T
DottaandPaperclip 382cb3bede feat(oauth): restack OAuth backbone
Restack the OAuth backend from PR #5584 onto current master for PAP-9233, preserving the provider registry, OAuth routes, refresh worker, resolver integration, tests, and docs.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-12 09:47:09 -05:00

8 lines
234 B
TypeScript

const CAP_SECONDS = 3600;
export function backoffSeconds(attempts: number): number {
if (attempts < 0 || !Number.isFinite(attempts)) return 30;
const exp = Math.min(attempts, 30);
return Math.min(2 ** exp * 30, CAP_SECONDS);
}