Type Alias RetryPolicy

RetryPolicy: {
    backoffFactor?: number;
    initialInterval?: number;
    jitter?: boolean;
    maxAttempts?: number;
    maxInterval?: number;
    retryOn?: (e: any) => boolean;
}

Type declaration

  • OptionalbackoffFactor?: number

    Multiplier by which the interval increases after each retry.

    2
    
  • OptionalinitialInterval?: number

    Amount of time that must elapse before the first retry occurs in milliseconds.

    500
    
  • Optionaljitter?: boolean

    Whether to add random jitter to the interval between retries.

  • OptionalmaxAttempts?: number

    Maximum amount of time that may elapse between retries.

    3
    
  • OptionalmaxInterval?: number

    Maximum amount of time that may elapse between retries in milliseconds.

    128000
    
  • OptionalretryOn?: (e: any) => boolean

    A function that returns True for exceptions that should trigger a retry.