apply micro commit 2eb19c2e97d9316438bc66cd2cda896e8c99d026

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2020-11-30 22:48:00 +03:00
parent 8d6eb34aee
commit 0ddc8de00b
2 changed files with 19 additions and 8 deletions

View File

@@ -1,6 +1,8 @@
package roundrobin
import (
"math/rand"
"github.com/unistack-org/micro/v3/selector"
)
@@ -17,7 +19,7 @@ func (r *roundrobin) Select(routes []string, opts ...selector.SelectOption) (sel
return nil, selector.ErrNoneAvailable
}
var i int
i := rand.Intn(len(routes))
return func() string {
route := routes[i%len(routes)]