The type signature for fetch's retryOn
function.
The default exponential backoff delay function used by fetch when it needs to retry a request.
Note that since Functions are limited to 10 seconds of runtime, requests that use this delay function can only retry a maximum of 4 times (8 seconds).
An implementation of the Fetch API. This Fetch implementation supports automatic retries on failure with (by default) exponential backoff, in addition to the standard Fetch API features.
Note that Functions are limited to 10 seconds of runtime, which imposes a cap on the maximum number of retries and amount of time between retries for failed requests. The default delay function allows for a maximum number of 4 retries before the Function times out, but other requests and time spent executing code will lower the practical maximum.
Usage: const response = await fetch(url, options);
The options
object supports the following non-standard fields:
retries
: The number of retries to attempt (default 0; no retries)retryDelay
: A function or number used to calculate the number of milliseconds to delay between retries (default exponentialDelay)retryOn
: An array of HTTP status codes that cause a retry (defaults to the set of network-related status codes)
Generated using TypeDoc
The type signature for fetch's
retryDelay
function.