- const chosenWorkerNodeKey = this.nextWorkerNodeKey
- this.weightedRoundRobinNextWorkerNodeKey()
- if (!this.isWorkerNodeEligible(this.nextWorkerNodeKey as number)) {
- this.nextWorkerNodeKey = undefined
- this.previousWorkerNodeKey =
- chosenWorkerNodeKey ?? this.previousWorkerNodeKey
- }
- return chosenWorkerNodeKey
+ this.setPreviousWorkerNodeKey(this.nextWorkerNodeKey)
+ return this.weightedRoundRobinNextWorkerNodeKey()