Skip to main content

shared/utils/backoff

Backoff delay helpers for retry loops.

Remarksโ€‹

Centralizes backoff math in shared code so retrying code paths (renderer, main, and shared utilities) stay consistent and we avoid off-by-one drift when different call sites interpret "attempt" differently.

The primary API uses a 0-based attemptIndex:

  • attemptIndex = 0 โ†’ first retry delay
  • attemptIndex = 1 โ†’ second retry delay

This matches common patterns like 2 ** attemptIndex * baseDelayMs.

Interfacesโ€‹

Type Aliasesโ€‹

Functionsโ€‹