From: Jérôme Benoit Date: Fri, 18 Aug 2023 20:29:44 +0000 (+0200) Subject: refactor: comment out unused code X-Git-Tag: v2.6.29~2 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=9a9f863cef6b6fd9ec4d082920196845238e6b61;p=poolifier.git refactor: comment out unused code Signed-off-by: Jérôme Benoit --- diff --git a/src/utils.ts b/src/utils.ts index c92edc91..efd1f124 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -58,21 +58,21 @@ export const availableParallelism = (): number => { return availableParallelism } -/** - * Computes the retry delay in milliseconds using an exponential back off algorithm. - * - * @param retryNumber - The number of retries that have already been attempted - * @param maxDelayRatio - The maximum ratio of the delay that can be randomized - * @returns Delay in milliseconds - */ -export const exponentialDelay = ( - retryNumber = 0, - maxDelayRatio = 0.2 -): number => { - const delay = Math.pow(2, retryNumber) * 100 - const randomSum = delay * maxDelayRatio * Math.random() // 0-(maxDelayRatio*100)% of the delay - return delay + randomSum -} +// /** +// * Computes the retry delay in milliseconds using an exponential back off algorithm. +// * +// * @param retryNumber - The number of retries that have already been attempted +// * @param maxDelayRatio - The maximum ratio of the delay that can be randomized +// * @returns Delay in milliseconds +// */ +// export const exponentialDelay = ( +// retryNumber = 0, +// maxDelayRatio = 0.2 +// ): number => { +// const delay = Math.pow(2, retryNumber) * 100 +// const randomSum = delay * maxDelayRatio * Math.random() // 0-(maxDelayRatio*100)% of the delay +// return delay + randomSum +// } /** * Computes the median of the given data set.