*/
private readonly defaultWorkerWeight: number
/**
- * Worker virtual task runtime.
+ * Worker node virtual task runtime.
*/
- private workerVirtualTaskRunTime: number = 0
+ private workerNodeVirtualTaskRunTime: number = 0
/** @inheritDoc */
public constructor (
/** @inheritDoc */
public reset (): boolean {
this.resetWorkerNodeKeyProperties()
- this.workerVirtualTaskRunTime = 0
+ this.workerNodeVirtualTaskRunTime = 0
return true
}
this.reset()
}
if (this.nextWorkerNodeKey === workerNodeKey) {
- this.workerVirtualTaskRunTime = 0
+ this.workerNodeVirtualTaskRunTime = 0
if (this.nextWorkerNodeKey > this.pool.workerNodes.length - 1) {
this.nextWorkerNodeKey = this.pool.workerNodes.length - 1
}
this.opts.weights?.[
this.nextWorkerNodeKey ?? this.previousWorkerNodeKey
] ?? this.defaultWorkerWeight
- if (this.workerVirtualTaskRunTime < workerWeight) {
- this.workerVirtualTaskRunTime =
- this.workerVirtualTaskRunTime +
- this.getWorkerTaskRunTime(
+ if (this.workerNodeVirtualTaskRunTime < workerWeight) {
+ this.workerNodeVirtualTaskRunTime =
+ this.workerNodeVirtualTaskRunTime +
+ this.getWorkerNodeTaskRunTime(
this.nextWorkerNodeKey ?? this.previousWorkerNodeKey
)
} else {
this.nextWorkerNodeKey === this.pool.workerNodes.length - 1
? 0
: (this.nextWorkerNodeKey ?? this.previousWorkerNodeKey) + 1
- this.workerVirtualTaskRunTime = 0
+ this.workerNodeVirtualTaskRunTime = 0
}
return this.nextWorkerNodeKey
}