Skip to content

Commit

Permalink
Tweak docs wording a bit more
Browse files Browse the repository at this point in the history
  • Loading branch information
Frank van Wijk committed Oct 31, 2022
1 parent 945a07f commit c90d1d7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 0 additions & 3 deletions .vscode/settings.json

This file was deleted.

3 changes: 2 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,9 @@ If `retry` is a number, it will be used as `limit` and other defaults will remai

If `maxRetryAfter` is set to `undefined`, it will use `options.timeout`. If [`Retry-After`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) header is greater than `maxRetryAfter`, it will cancel the request.

By default, the delay is calculated with `0.3 * (2 ** (attemptCount - 1)) * 1000`. The delay increases exponentially.
The `backoffLimit` option is the upper limit of the delay per retry in milliseconds.
To clamp the delay, set `backoffLimit` to 1000, for example.
By default, the delay is calculated with `0.3 * (2 ** (attemptCount - 1)) * 1000`. The delay increases exponentially.

Retries are not triggered following a [timeout](#timeout).

Expand Down
3 changes: 2 additions & 1 deletion source/types/retry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export interface RetryOptions {

/**
The upper limit of the delay per retry in milliseconds.
To clamp the delay, set `backoffLimit` to 1000, for example.
By default, the delay is calculated in the following way:
Expand All @@ -45,7 +46,7 @@ export interface RetryOptions {
The delay increases exponentially.
To clamp the delay, set `backoffLimit` to 1000, for example.
@default Infinity
*/
backoffLimit?: number;
}

0 comments on commit c90d1d7

Please sign in to comment.