fix(retry): use literal values in retryConfigs to fix ESM initialization

Hardcode values in retryConfigs.rsocket instead of referencing
RETRY_BACKOFF_DELAYS and RETRY_JITTER_FACTOR to avoid
"Cannot access before initialization" error in ESM module loading.
This commit is contained in:
Claude
2026-01-20 14:25:56 +00:00
parent cf979d6b6d
commit 890a80da48
+5 -5
View File
@@ -656,14 +656,14 @@ export const retryConfigs = {
/** /**
* RSocket-style retry with stepped delays * RSocket-style retry with stepped delays
* Uses fixed delay array: 1s, 2s, 5s, 10s, 20s (with ±15% jitter) * Uses fixed delay array: 1s, 2s, 5s, 10s, 20s (with ±15% jitter)
* Unlike exponential, this uses exact delays from RETRY_BACKOFF_DELAYS * Values hardcoded to avoid initialization order issues in ESM
*/ */
rsocket: { rsocket: {
maxAttempts: RETRY_BACKOFF_DELAYS.length, maxAttempts: 5, // RETRY_BACKOFF_DELAYS.length
baseDelay: RETRY_BACKOFF_DELAYS[0], baseDelay: 1000, // RETRY_BACKOFF_DELAYS[0]
maxDelay: RETRY_BACKOFF_DELAYS[RETRY_BACKOFF_DELAYS.length - 1], maxDelay: 20000, // RETRY_BACKOFF_DELAYS[4]
backoffStrategy: 'stepped' as const, backoffStrategy: 'stepped' as const,
jitter: RETRY_JITTER_FACTOR, jitter: 0.15, // RETRY_JITTER_FACTOR
}, },
} }