Reference / @open-music-sdk/core / tRetryPolicy
Interface: tRetryPolicy
Defined in: packages/core/src/retry.ts:5
Every field is optional and an explicit undefined means the default. Invalid values throw a TypeError.
Properties
baseDelayMs?
readonly optional baseDelayMs?: number;Defined in: packages/core/src/retry.ts:9
Upper bound of the first backoff in milliseconds; doubles each attempt. Default 250.
maxAttempts?
readonly optional maxAttempts?: number;Defined in: packages/core/src/retry.ts:7
Attempts in total, the first included. A positive integer. Default 2.
maxDelayMs?
readonly optional maxDelayMs?: number;Defined in: packages/core/src/retry.ts:11
Cap on the backoff. A Retry-After header is honoured beyond it, up to maxRetryAfterMs. Default 4000.
maxRetryAfterMs?
readonly optional maxRetryAfterMs?: number;Defined in: packages/core/src/retry.ts:16
The longest Retry-After to wait for. A longer one is not waited for: the error is thrown at once with retryAfterMs attached so the caller can decide. Default 60 000; at most 2^31 - 1 (setTimeout's limit).
retryOn?
readonly optional retryOn?: (error) => boolean;Defined in: packages/core/src/retry.ts:18
Which errors deserve another attempt. Default: retryable. A client asks this of a POST only for an error that says the POST was not carried out.
Parameters
error
Returns
boolean