From ad7597c0b167a849d3d424ca4ac41b3004f633d7 Mon Sep 17 00:00:00 2001 From: Wang-TaoTao <53828914+Wang-TaoTao@users.noreply.github.com> Date: Wed, 31 Aug 2022 21:42:54 +0800 Subject: [PATCH] fix: init global selector to wrr (#2323) --- transport/grpc/client.go | 4 ++-- transport/http/client.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/transport/grpc/client.go b/transport/grpc/client.go index a1424d209..da6ceb028 100644 --- a/transport/grpc/client.go +++ b/transport/grpc/client.go @@ -10,7 +10,7 @@ import ( "github.com/go-kratos/kratos/v2/middleware" "github.com/go-kratos/kratos/v2/registry" "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/grpc/resolver/discovery" @@ -25,7 +25,7 @@ import ( func init() { if selector.GlobalSelector() == nil { - selector.SetGlobalSelector(p2c.NewBuilder()) + selector.SetGlobalSelector(wrr.NewBuilder()) } } diff --git a/transport/http/client.go b/transport/http/client.go index 79ac4f911..c0ad5ee38 100644 --- a/transport/http/client.go +++ b/transport/http/client.go @@ -16,13 +16,13 @@ import ( "github.com/go-kratos/kratos/v2/middleware" "github.com/go-kratos/kratos/v2/registry" "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" ) func init() { if selector.GlobalSelector() == nil { - selector.SetGlobalSelector(p2c.NewBuilder()) + selector.SetGlobalSelector(wrr.NewBuilder()) } }