Skip to content

Commit 38bbb04

Browse files
authoredAug 27, 2020
Fix retry delay function in the README (#1425)
1 parent 0d43f5f commit 38bbb04

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ An object representing `limit`, `calculateDelay`, `methods`, `statusCodes`, `max
513513
If `maxRetryAfter` is set to `undefined`, it will use `options.timeout`.\
514514
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.
515515

516-
Delays between retries counts with function `1000 * Math.pow(2, retry) + Math.random() * 100`, where `retry` is attempt number (starts from 1).
516+
Delays between retries counts with function `1000 * Math.pow(2, retry - 1) + Math.random() * 100`, where `retry` is attempt number (starts from 1).
517517

518518
The `calculateDelay` property is a `function` that receives an object with `attemptCount`, `retryOptions`, `error` and `computedValue` properties for current retry count, the retry options, error and default computed value. The function must return a delay in milliseconds (or a Promise resolving with it) (`0` return value cancels retry).
519519

0 commit comments

Comments
 (0)
Please sign in to comment.