- // if (this.isWorkerNodeReady(workerNodeKey) && workerWeight >= this.roundWeights[roundIndex]) {
- if (workerWeight >= this.roundWeights[roundIndex]) {
- roundId = roundIndex
- workerNodeId = workerNodeKey
- break
+ if (
+ workerWeight >= this.roundWeights[roundIndex] &&
+ this.workerNodeVirtualTaskRunTime < workerWeight
+ ) {
+ this.workerNodeVirtualTaskRunTime =
+ this.workerNodeVirtualTaskRunTime +
+ this.getWorkerNodeTaskRunTime(workerNodeKey)
+ this.setPreviousWorkerNodeKey(this.nextWorkerNodeKey)
+ this.nextWorkerNodeKey = workerNodeKey
+ return this.nextWorkerNodeKey