fix: init global selector to wrr (#2323)

pull/2312/head
Wang-TaoTao 2 years ago committed by GitHub
parent cbfb6db9cf
commit ad7597c0b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      transport/grpc/client.go
  2. 4
      transport/http/client.go

@ -10,7 +10,7 @@ import (
"github.com/go-kratos/kratos/v2/middleware" "github.com/go-kratos/kratos/v2/middleware"
"github.com/go-kratos/kratos/v2/registry" "github.com/go-kratos/kratos/v2/registry"
"github.com/go-kratos/kratos/v2/selector" "github.com/go-kratos/kratos/v2/selector"
"github.com/go-kratos/kratos/v2/selector/p2c" "github.com/go-kratos/kratos/v2/selector/wrr"
"github.com/go-kratos/kratos/v2/transport" "github.com/go-kratos/kratos/v2/transport"
"github.com/go-kratos/kratos/v2/transport/grpc/resolver/discovery" "github.com/go-kratos/kratos/v2/transport/grpc/resolver/discovery"
@ -25,7 +25,7 @@ import (
func init() { func init() {
if selector.GlobalSelector() == nil { if selector.GlobalSelector() == nil {
selector.SetGlobalSelector(p2c.NewBuilder()) selector.SetGlobalSelector(wrr.NewBuilder())
} }
} }

@ -16,13 +16,13 @@ import (
"github.com/go-kratos/kratos/v2/middleware" "github.com/go-kratos/kratos/v2/middleware"
"github.com/go-kratos/kratos/v2/registry" "github.com/go-kratos/kratos/v2/registry"
"github.com/go-kratos/kratos/v2/selector" "github.com/go-kratos/kratos/v2/selector"
"github.com/go-kratos/kratos/v2/selector/p2c" "github.com/go-kratos/kratos/v2/selector/wrr"
"github.com/go-kratos/kratos/v2/transport" "github.com/go-kratos/kratos/v2/transport"
) )
func init() { func init() {
if selector.GlobalSelector() == nil { if selector.GlobalSelector() == nil {
selector.SetGlobalSelector(p2c.NewBuilder()) selector.SetGlobalSelector(wrr.NewBuilder())
} }
} }

Loading…
Cancel
Save