Home / Function/ exponentialBackoff() — supabase Function Reference

exponentialBackoff() — supabase Function Reference

Architecture documentation for the exponentialBackoff() function in generate-embeddings.ts from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  b2e63f56_abf5_e0ab_c5a4_eff3e24b6d44["exponentialBackoff()"]
  999b9bcb_cbf3_994c_468b_34a61e74d416["withRetry()"]
  999b9bcb_cbf3_994c_468b_34a61e74d416 -->|calls| b2e63f56_abf5_e0ab_c5a4_eff3e24b6d44
  style b2e63f56_abf5_e0ab_c5a4_eff3e24b6d44 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/docs/scripts/search/generate-embeddings.ts lines 47–51

function exponentialBackoff(attempt: number, baseDelay: number, maxDelay: number = 30_000): number {
  const exponentialDelay = baseDelay * Math.pow(2, attempt)
  const jitter = (Math.random() - 0.5) * 0.1 * exponentialDelay
  return Math.min(Math.max(0, exponentialDelay + jitter), maxDelay)
}

Subdomains

Called By

Frequently Asked Questions

What does exponentialBackoff() do?
exponentialBackoff() is a function in the supabase codebase.
What calls exponentialBackoff()?
exponentialBackoff() is called by 1 function(s): withRetry.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free