Interface HttpRetryOptions

HTTP retry options to be used in each of the requests.

interface HttpRetryOptions {
    attempts?: number;
    expBase?: number;
    httpStatusCodes?: number[];
    initialDelay?: number;
    jitter?: number;
    maxDelay?: number;
}

Properties

attempts?: number

Maximum number of attempts, including the original request. If 0 or 1, it means no retries. If not specified, default to 5.

expBase?: number

Multiplier by which the delay increases after each attempt. If not specified, default to 2.0.

httpStatusCodes?: number[]

List of HTTP status codes that should trigger a retry. If not specified, a default set of retryable codes (408, 429, and 5xx) may be used.

initialDelay?: number

Initial delay before the first retry, in fractions of a second. If not specified, default to 1.0 second.

jitter?: number

Randomness factor for the delay. If not specified, default to 1.0.

maxDelay?: number

Maximum delay between retries, in fractions of a second. If not specified, default to 60.0 seconds.