From 9307fef3e5f9e5f929fd8755078913a33c2dc783 Mon Sep 17 00:00:00 2001 From: OdedShimoni <45061444+OdedShimoni@users.noreply.github.com> Date: Tue, 15 Oct 2024 00:05:34 +0300 Subject: [PATCH] docs: min instead of max in attempts made or truncate in custom backoff (#2830) --- docs/gitbook/bull/patterns/custom-backoff-strategy.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/gitbook/bull/patterns/custom-backoff-strategy.md b/docs/gitbook/bull/patterns/custom-backoff-strategy.md index 3ebbbb396e..25b9f78679 100644 --- a/docs/gitbook/bull/patterns/custom-backoff-strategy.md +++ b/docs/gitbook/bull/patterns/custom-backoff-strategy.md @@ -46,7 +46,7 @@ const myQueue = new Queue("Server B", { console.error({ attemptsMade, err, options }); return Math.round( Math.random() * - (Math.pow(2, Math.max(attemptsMade, truncate)) - 1) * + (Math.pow(2, Math.min(attemptsMade, truncate)) - 1) * delay ); },