MCPcopy Index your code
hub / github.com/simstudioai/sim / calculateBackoff

Function calculateBackoff

apps/sim/tools/index.ts:1489–1492  ·  view source on GitHub ↗
(attempt: number, initialDelayMs: number, maxDelayMs: number)

Source from the content-addressed store, hash-verified

1487}
1488
1489function calculateBackoff(attempt: number, initialDelayMs: number, maxDelayMs: number): number {
1490 const base = Math.min(initialDelayMs * 2 ** attempt, maxDelayMs)
1491 return Math.round(base / 2 + randomFloat() * (base / 2))
1492}
1493
1494function parseRetryAfterHeader(header: string | null): number {
1495 if (!header) return 0

Callers 1

executeToolRequestFunction · 0.85

Calls 1

randomFloatFunction · 0.90

Tested by

no test coverage detected