- this.currentRoundId = roundId ?? 0
- this.currentWorkerNodeId = workerNodeId ?? 0
- const chosenWorkerNodeKey = this.currentWorkerNodeId
- if (this.currentWorkerNodeId === this.pool.workerNodes.length - 1) {
- this.currentWorkerNodeId = 0
- this.currentRoundId =
- this.currentRoundId === this.roundWeights.length - 1
- ? 0
- : this.currentRoundId + 1
+ this.roundId = roundId ?? 0
+ this.nextWorkerNodeKey = workerNodeId ?? 0
+ const chosenWorkerNodeKey = this.nextWorkerNodeKey
+ if (this.nextWorkerNodeKey === this.pool.workerNodes.length - 1) {
+ this.nextWorkerNodeKey = 0
+ this.roundId =
+ this.roundId === this.roundWeights.length - 1 ? 0 : this.roundId + 1