refactor: silence sonar code smells
[poolifier.git] / src / pools / abstract-pool.ts
index be8ec1a0125644bbcb00b3a5ec48e3056e16ed11..41b23a8c86fc2ebd55a8fe140c620137956df9df 100644 (file)
@@ -255,19 +255,19 @@ export abstract class AbstractPool<
       )
     }
     if (
-      workerChoiceStrategyOptions.choiceRetries != null &&
-      !Number.isSafeInteger(workerChoiceStrategyOptions.choiceRetries)
+      workerChoiceStrategyOptions.retries != null &&
+      !Number.isSafeInteger(workerChoiceStrategyOptions.retries)
     ) {
       throw new TypeError(
-        'Invalid worker choice strategy options: choice retries must be an integer'
+        'Invalid worker choice strategy options: retries must be an integer'
       )
     }
     if (
-      workerChoiceStrategyOptions.choiceRetries != null &&
-      workerChoiceStrategyOptions.choiceRetries < 0
+      workerChoiceStrategyOptions.retries != null &&
+      workerChoiceStrategyOptions.retries < 0
     ) {
       throw new RangeError(
-        `Invalid worker choice strategy options: choice retries '${workerChoiceStrategyOptions.choiceRetries}' must be greater or equal than zero`
+        `Invalid worker choice strategy options: retries '${workerChoiceStrategyOptions.retries}' must be greater or equal than zero`
       )
     }
     if (
@@ -1427,7 +1427,6 @@ export abstract class AbstractPool<
   private addWorkerNode (worker: Worker): number {
     const workerNode = new WorkerNode<Worker, Data>(
       worker,
-      this.worker,
       this.opts.tasksQueueOptions?.size ?? Math.pow(this.maxSize, 2)
     )
     // Flag the worker node as ready at pool startup.