build: refine eslint configuration after ESM defaulting
[poolifier.git] / src / pools / selection-strategies / interleaved-weighted-round-robin-worker-choice-strategy.ts
index 0f718e9817159bd6aedb5012e3246786d4696f50..db439f0209c2ddf21cbe081f3d2b72138453545b 100644 (file)
@@ -1,12 +1,12 @@
-import type { IWorker } from '../worker'
-import type { IPool } from '../pool'
-import { DEFAULT_MEASUREMENT_STATISTICS_REQUIREMENTS } from '../../utils'
-import { AbstractWorkerChoiceStrategy } from './abstract-worker-choice-strategy'
+import type { IWorker } from '../worker.js'
+import type { IPool } from '../pool.js'
+import { DEFAULT_MEASUREMENT_STATISTICS_REQUIREMENTS } from '../../utils.js'
+import { AbstractWorkerChoiceStrategy } from './abstract-worker-choice-strategy.js'
 import type {
   IWorkerChoiceStrategy,
   InternalWorkerChoiceStrategyOptions,
   TaskStatisticsRequirements
-} from './selection-strategies-types'
+} from './selection-strategies-types.js'
 
 /**
  * Selects the next worker with an interleaved weighted round robin scheduling algorithm.
@@ -40,7 +40,7 @@ export class InterleavedWeightedRoundRobinWorkerChoiceStrategy<
   /**
    * Round weights.
    */
-  private roundWeights!: number[]
+  private roundWeights: number[]
   /**
    * Worker node id.
    */
@@ -56,7 +56,8 @@ export class InterleavedWeightedRoundRobinWorkerChoiceStrategy<
     opts: InternalWorkerChoiceStrategyOptions
   ) {
     super(pool, opts)
-    this.setOptions(this.opts)
+    this.setTaskStatisticsRequirements(this.opts)
+    this.roundWeights = this.getRoundWeights()
   }
 
   /** @inheritDoc */