@tikoci/centrs
    Preparing search index...

    Function runWithRetry

    • Run run, retrying only isRetryableFanoutError failures up to maxRetries times with jittered backoff. mayRetry vetoes a retry the allowlist would allow, e.g. a write that was already sent (#448). A non-retryable error, or the final exhausted attempt, is converted to a value via recover (so a fan-out target yields an inner error envelope instead of throwing out of the batch).

      Type Parameters

      • T

      Parameters

      • run: () => Promise<T>
      • recover: (error: unknown) => T
      • options: {
            maxRetries?: number;
            mayRetry?: (error: unknown) => boolean;
            sleep?: (ms: number) => Promise<void>;
        } = {}

      Returns Promise<T>