OptionalafterOptionalfactorThe exponential factor to use.
OptionalmaxThe maximum time (in milliseconds) that the retried operation is allowed to run.
OptionalmaxThe maximum number of milliseconds between two retries.
OptionalmethodsThe methods to retry. Both statusCodes and network errors are only
retried for these methods, so non-idempotent methods like POST and
PATCH are not retried unless added here or allowed by shouldRetry.
OptionalminThe number of milliseconds before starting the first retry.
OptionalrandomizeRandomizes the timeouts by multiplying a factor between 1-2.
OptionalretriesThe maximum amount of times to retry the operation.
When poll is also enabled, each retry reruns the whole polling loop and
restarts its counter, so up to (retries + 1) × poll.limit requests can be made.
The default timeout is sized for that worst case.
OptionalshouldDecide whether to retry a failed attempt. Called for every failure while
retries are left, and its return value replaces the built-in checks
(methods, statusCodes and network errors).
context.defaultShouldRetry holds the built-in decision, so return it to
keep the default behavior. Return true to retry requests the built-in
checks would not, for example an idempotent POST. retries and
maxRetryTime still apply.
When the request is retried, the body of the failed response is cancelled after this hook returns. Read it inside the hook, or clone it to keep it.
The context of the retry
OptionalstatusThe HTTP status codes to retry on. Status codes in the range 400-599.
OptionalunrefWhether to unref the setTimeout's.
The status codes to retry after
Request will wait until the date or number of seconds given in the Retry-After header has passed to retry the request. If Retry-After is missing, the non-standard RateLimit-Reset header (seconds) is used in its place as a fallback, then X-RateLimit-Reset or X-Rate-Limit-Reset (Unix timestamp in seconds). If the provided status code is not in the list, the Retry-After header will be ignored.
The wait only happens when the request will be retried, and it replaces the backoff delay. If the wait doesn't fit in the remaining
timeoutormaxRetryTime, theHttpErroris returned right away. Retries after a Retry-After wait count againstretries.