mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-23 09:07:46 +02:00
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>
8 lines
234 B
TypeScript
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);
|
|
}
|