mirror of
https://github.com/go-micro/go-micro.git
synced 2024-12-24 10:07:04 +02:00
change where we order the routes
This commit is contained in:
parent
934b8eb86d
commit
955dc2a23d
@ -110,6 +110,10 @@ func (p *Proxy) getRoute(service string) ([]router.Route, error) {
|
||||
for _, v := range r {
|
||||
routes = append(routes, v)
|
||||
}
|
||||
|
||||
// sort the routes in order of metric
|
||||
sort.Slice(routes, func(i, j int) bool { return routes[i].Metric < routes[j].Metric })
|
||||
|
||||
return routes
|
||||
}
|
||||
|
||||
@ -253,9 +257,6 @@ func (p *Proxy) ServeRequest(ctx context.Context, req server.Request, rsp server
|
||||
return p.serveRequest(ctx, p.Client, service, endpoint, req, rsp, client.WithAddress(addresses...))
|
||||
}
|
||||
|
||||
// sort the routes in order of metric
|
||||
sort.Slice(routes, func(i, j int) bool { return routes[i].Metric < routes[j].Metric })
|
||||
|
||||
// there's no links e.g we're local routing then just serve it with addresses
|
||||
if local {
|
||||
var opts []client.CallOption
|
||||
|
Loading…
Reference in New Issue
Block a user