MCPcopy Index your code
hub / github.com/codeaashu/claude-code / getRetryDelay

Function getRetryDelay

src/services/api/withRetry.ts:530–548  ·  view source on GitHub ↗
(
  attempt: number,
  retryAfterHeader?: string | null,
  maxDelayMs = 32000,
)

Source from the content-addressed store, hash-verified

528}
529
530export function getRetryDelay(
531 attempt: number,
532 retryAfterHeader?: string | null,
533 maxDelayMs = 32000,
534): number {
535 if (retryAfterHeader) {
536 const seconds = parseInt(retryAfterHeader, 10)
537 if (!isNaN(seconds)) {
538 return seconds * 1000
539 }
540 }
541
542 const baseDelay = Math.min(
543 BASE_DELAY_MS * Math.pow(2, attempt - 1),
544 maxDelayMs,
545 )
546 const jitter = Math.random() * 0.25 * baseDelay
547 return baseDelay + jitter
548}
549
550export function parseMaxTokensContextOverflowError(error: APIError):
551 | {

Callers 6

streamCompactSummaryFunction · 0.85
fetchWithRetryFunction · 0.85
fetchWithRetryFunction · 0.85
fetchTeamMemoryFunction · 0.85
withRetryFunction · 0.85
fetchUserSettingsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected