fix: ensure the number of worker choice retries is enough for WRR
[poolifier.git] / src / utils.ts
index 25233a022aac69f9db858907261ad6720e5e495e..2dd3947c2f42bf081473dc08ccb34bf4cf30e4b1 100644 (file)
@@ -22,16 +22,16 @@ export const EMPTY_FUNCTION: () => void = Object.freeze(() => {
 })
 
 /**
- * Default worker choice strategy options.
+ * Gets default worker choice strategy options.
  *
- * @param poolMaxSize - The pool maximum size.
+ * @param retries - The number of worker choice retries.
  * @returns The default worker choice strategy options.
  */
 export const getDefaultInternalWorkerChoiceStrategyOptions = (
-  poolMaxSize: number
+  retries: number
 ): InternalWorkerChoiceStrategyOptions => {
   return {
-    retries: poolMaxSize,
+    retries,
     runTime: { median: false },
     waitTime: { median: false },
     elu: { median: false }