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