fix grpc client
This commit is contained in:
parent
2313df0bca
commit
cf1e0d30eb
|
@ -13,6 +13,7 @@ import (
|
|||
{import}
|
||||
"git.apinb.com/bsm-sdk/core/vars"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/credentials/insecure"
|
||||
"google.golang.org/grpc/reflection"
|
||||
"google.golang.org/protobuf/proto"
|
||||
gwRuntime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
|
||||
|
@ -42,7 +43,7 @@ func New(addr string) *Server {
|
|||
conn, ok := srv.grpcConns[addr]
|
||||
if !ok {
|
||||
var err error
|
||||
conn, err = grpc.Dial(addr, grpc.WithInsecure())
|
||||
conn, err = grpc.NewClient(addr, grpc.WithTransportCredentials(insecure.NewCredentials()))
|
||||
if err != nil {
|
||||
panic("failed to dial grpc server: " + err.Error())
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue