X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fselection-strategies%2Fweighted-round-robin-worker-choice-strategy.ts;h=5338b320b0586bab67195ed5b93e23a0e74cd2f0;hb=2885534c1ebf36992a1664c3b26b9917522d4825;hp=fea72350ffafbb50b44f9a56935f17038952ef91;hpb=26ce26ca8861318068427cc86697103e7a3ddbf4;p=poolifier.git diff --git a/src/pools/selection-strategies/weighted-round-robin-worker-choice-strategy.ts b/src/pools/selection-strategies/weighted-round-robin-worker-choice-strategy.ts index fea72350..5338b320 100644 --- a/src/pools/selection-strategies/weighted-round-robin-worker-choice-strategy.ts +++ b/src/pools/selection-strategies/weighted-round-robin-worker-choice-strategy.ts @@ -34,10 +34,6 @@ export class WeightedRoundRobinWorkerChoiceStrategy< elu: DEFAULT_MEASUREMENT_STATISTICS_REQUIREMENTS } - /** - * Default worker weight. - */ - private readonly defaultWorkerWeight: number /** * Worker node virtual task runtime. */ @@ -50,7 +46,6 @@ export class WeightedRoundRobinWorkerChoiceStrategy< ) { super(pool, opts) this.setTaskStatisticsRequirements(this.opts) - this.defaultWorkerWeight = this.computeDefaultWorkerWeight() } /** @inheritDoc */ @@ -94,10 +89,9 @@ export class WeightedRoundRobinWorkerChoiceStrategy< } private weightedRoundRobinNextWorkerNodeKey (): number | undefined { - const workerWeight = - this.opts.weights?.[ - this.nextWorkerNodeKey ?? this.previousWorkerNodeKey - ] ?? this.defaultWorkerWeight + const workerWeight = this.opts.weights?.[ + this.nextWorkerNodeKey ?? this.previousWorkerNodeKey + ] as number if (this.workerNodeVirtualTaskRunTime < workerWeight) { this.workerNodeVirtualTaskRunTime = this.workerNodeVirtualTaskRunTime +