Skip to content

Commit

Permalink
#888 fix WRR selector
Browse files Browse the repository at this point in the history
  • Loading branch information
smallnest committed Jan 28, 2025
1 parent da8106c commit 0b3b436
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions client/selector.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ func (s *weightedRoundRobinSelector) Select(ctx context.Context, servicePath, se
}

func (s *weightedRoundRobinSelector) UpdateServer(servers map[string]string) {
ss := createWeighted(servers)
s.buildRing()
s.servers = ss
newServer := newWeightedRoundRobinSelector(servers).(*weightedRoundRobinSelector)
*s = *newServer
}

func (s *weightedRoundRobinSelector) buildRing() {
s.totalWeight = 0
for _, w := range s.servers {
Expand Down

0 comments on commit 0b3b436

Please sign in to comment.