Use random starting index for roundrobin
This commit is contained in:
parent
db948d0dc3
commit
b3cdbaae1a
@ -38,7 +38,7 @@ func RoundRobin(services []*registry.Service) Next {
|
|||||||
nodes = append(nodes, service.Nodes...)
|
nodes = append(nodes, service.Nodes...)
|
||||||
}
|
}
|
||||||
|
|
||||||
var i int
|
var i = rand.Int()
|
||||||
var mtx sync.Mutex
|
var mtx sync.Mutex
|
||||||
|
|
||||||
return func() (*registry.Node, error) {
|
return func() (*registry.Node, error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user