elu: DEFAULT_MEASUREMENT_STATISTICS_REQUIREMENTS
}
- /**
- * Default worker weight.
- */
- private readonly defaultWorkerWeight: number
/**
* Worker node virtual task runtime.
*/
opts: InternalWorkerChoiceStrategyOptions
) {
super(pool, opts)
- this.setTaskStatisticsRequirements(this.opts)
- this.defaultWorkerWeight = this.computeDefaultWorkerWeight()
+ this.setOptions(this.opts)
}
/** @inheritDoc */
}
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 +