Skip to content

Commit

Permalink
add weighted_lb feature
Browse files Browse the repository at this point in the history
  • Loading branch information
liangwei3 committed Apr 3, 2024
1 parent a4484e4 commit ad5ae82
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions lb/weightRoundRobinLb.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"math/rand"
"sync"
"sync/atomic"
"time"
)

type WeightRoundRobinLB struct {
Expand Down Expand Up @@ -207,7 +206,6 @@ func (r *weightedRingSelector) DoSelect(request motan.Request) motan.EndPoint {
return ep
}
// If the ep is not available, loop selection from random position
rand.Seed(time.Now().UnixNano())
start := rand.Intn(len(r.weightRing))
for i := 0; i < len(r.weightRing); i++ {
// byte could indicate 0~255
Expand Down

0 comments on commit ad5ae82

Please sign in to comment.