Use random starting index for roundrobin

This commit is contained in:
Asim 2016-10-29 09:31:32 +01:00
parent db948d0dc3
commit b3cdbaae1a

View File

@ -38,7 +38,7 @@ func RoundRobin(services []*registry.Service) Next {
nodes = append(nodes, service.Nodes...)
}
var i int
var i = rand.Int()
var mtx sync.Mutex
return func() (*registry.Node, error) {