diff --git a/src/Defaults/index.ts b/src/Defaults/index.ts index 9116ff43..5f22f2d5 100644 --- a/src/Defaults/index.ts +++ b/src/Defaults/index.ts @@ -169,15 +169,7 @@ export const DEFAULT_CACHE_MAX_KEYS = { LID_GLOBAL: 10_000 } -/** - * Retry configuration with custom progressive backoff - * Fixed delay steps in milliseconds: 1s → 2s → 5s → 10s → 20s - * Use with 'stepped' backoff strategy in retry-utils.ts - */ -export const RETRY_BACKOFF_DELAYS = [1000, 2000, 5000, 10000, 20000] - -/** - * Jitter factor for retry delays (0.15 = ±15% randomization) - * Helps prevent thundering herd problem - */ -export const RETRY_JITTER_FACTOR = 0.15 +// NOTE: RETRY_BACKOFF_DELAYS and RETRY_JITTER_FACTOR are defined in retry-utils.ts +// to avoid circular dependency and initialization order issues. +// Import from '@whiskeysockets/baileys' Utils if needed: +// import { getRetryDelayWithJitter, getAllRetryDelaysWithJitter } from './Utils/retry-utils' diff --git a/src/Utils/retry-utils.ts b/src/Utils/retry-utils.ts index 66594804..61affb88 100644 --- a/src/Utils/retry-utils.ts +++ b/src/Utils/retry-utils.ts @@ -20,15 +20,15 @@ import type { CircuitBreaker } from './circuit-breaker.js' /** * Retry configuration with custom progressive backoff * Fixed delay steps in milliseconds: 1s → 2s → 5s → 10s → 20s - * Defined locally to avoid circular dependency with Defaults + * Exported for external use (e.g., custom retry logic) */ -const RETRY_BACKOFF_DELAYS = [1000, 2000, 5000, 10000, 20000] +export const RETRY_BACKOFF_DELAYS = [1000, 2000, 5000, 10000, 20000] as const /** * Jitter factor for retry delays (0.15 = ±15% randomization) * Helps prevent thundering herd problem */ -const RETRY_JITTER_FACTOR = 0.15 +export const RETRY_JITTER_FACTOR = 0.15 /** * Backoff strategies