Skip to content

Commit

Permalink
Fixed missing imports in retry.md. (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
shrihari-prakash authored Jan 31, 2024
1 parent eb24035 commit 2094f8e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/content/api/module/retry.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ You can configure:

``` javascript
// Imports needed components
const { Circuit, Retry } = require('mollitia');
const { Circuit, Retry, RetryMode } = require('mollitia');
// Creates a circuit
const circuit = new Circuit({
options: {
Expand All @@ -34,7 +34,7 @@ const circuit = new Circuit({
attempts: 2, // Will retry two times
interval: 500,
mode: RetryMode.LINEAR,
factor: 1 // With interval=500, mode=LINEAR and factor 1, the interval between attempts will grow linearly (500ms before 1st retry, then 1000ms before 2nd retry)
factor: 1, // With interval=500, mode=LINEAR and factor 1, the interval between attempts will grow linearly (500ms before 1st retry, then 1000ms before 2nd retry)
onRejection: (err, attempt) => { // Can help filtering error and modifying the retry behavior
// Second parameter represent the current attempt
// In this example, onRejection will be called 3 times
Expand Down

0 comments on commit 2094f8e

Please sign in to comment.