From 2094f8e652c43f5ff6cf16fe7dd255ea6c6fdda3 Mon Sep 17 00:00:00 2001 From: Shri <35889246+shrihari-prakash@users.noreply.github.com> Date: Wed, 31 Jan 2024 18:57:59 +0530 Subject: [PATCH] Fixed missing imports in retry.md. (#15) --- docs/content/api/module/retry.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/content/api/module/retry.md b/docs/content/api/module/retry.md index a90b9d2..6f0be27 100644 --- a/docs/content/api/module/retry.md +++ b/docs/content/api/module/retry.md @@ -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: { @@ -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