Skip to content

Commit f248618

Browse files
authoredSep 9, 2020
Clarify the retry mechanism
Fixes #1143
1 parent 2b352d3 commit f248618

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed
 

‎readme.md

+2
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,8 @@ Delays between retries counts with function `1000 * Math.pow(2, retry - 1) + Mat
519519

520520
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).
521521

522+
**Note:** The `calculateDelay` function is responsible for the entire cache mechanism, including the `limit` property. To support it, you need to check whether `computedValue` is different than `0`.
523+
522524
By default, it retries *only* on the specified methods, status codes, and on these network errors:
523525
- `ETIMEDOUT`: One of the [timeout](#timeout) limits were reached.
524526
- `ECONNRESET`: Connection was forcibly closed by a peer.

0 commit comments

Comments
 (0)
Please sign in to comment.