Use random starting index for roundrobin
This commit is contained in:
@@ -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) {
|
||||||
|
Reference in New Issue
Block a user