fix: ensure worker choice is retried at least the pool max size
[poolifier.git] / src / pools / selection-strategies / least-used-worker-choice-strategy.ts
index 1bd8d059fd5f9bc40484db9bbece55d319eddcbc..6318affe0a306492fe7d1257d6a99e05e3938a67 100644 (file)
@@ -1,10 +1,9 @@
-import { DEFAULT_WORKER_CHOICE_STRATEGY_OPTIONS } from '../../utils'
 import type { IPool } from '../pool'
 import type { IWorker } from '../worker'
 import { AbstractWorkerChoiceStrategy } from './abstract-worker-choice-strategy'
 import type {
   IWorkerChoiceStrategy,
-  WorkerChoiceStrategyOptions
+  InternalWorkerChoiceStrategyOptions
 } from './selection-strategies-types'
 
 /**
@@ -24,10 +23,9 @@ export class LeastUsedWorkerChoiceStrategy<
   /** @inheritDoc */
   public constructor (
     pool: IPool<Worker, Data, Response>,
-    opts: WorkerChoiceStrategyOptions = DEFAULT_WORKER_CHOICE_STRATEGY_OPTIONS
+    opts: InternalWorkerChoiceStrategyOptions
   ) {
     super(pool, opts)
-    this.setTaskStatisticsRequirements(this.opts)
   }
 
   /** @inheritDoc */