refactor: dedupe worker choice strategy options handling code
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 31 Dec 2023 14:02:49 +0000 (15:02 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 31 Dec 2023 14:02:49 +0000 (15:02 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
src/pools/selection-strategies/abstract-worker-choice-strategy.ts

index 234eada738d22ea4cd472dfe64b1d269e8983f73..d8d8f32d2f9dc2eee45f63c75f2aa0ece167b108 100644 (file)
@@ -57,11 +57,7 @@ export abstract class AbstractWorkerChoiceStrategy<
     protected readonly pool: IPool<Worker, Data, Response>,
     protected opts?: WorkerChoiceStrategyOptions
   ) {
-    this.opts = buildWorkerChoiceStrategyOptions<Worker, Data, Response>(
-      this.pool,
-      this.opts
-    )
-    this.setTaskStatisticsRequirements(this.opts)
+    this.setOptions(this.opts)
     this.choose = this.choose.bind(this)
   }