Ver Fonte

feat:xiugai

wangchuanjin há 1 mês atrás
pai
commit
51d78a9e1f
1 ficheiros alterados com 6 adições e 6 exclusões
  1. 6 6
      client.go

+ 6 - 6
client.go

@@ -7,7 +7,6 @@ import (
 	"encoding/json"
 	"errors"
 	"google.golang.org/grpc"
-	"google.golang.org/grpc/keepalive"
 	"io"
 	"jygit.jydev.jianyu360.cn/BaseService/ossClient/constant"
 	"jygit.jydev.jianyu360.cn/BaseService/ossClient/entity"
@@ -249,11 +248,12 @@ func RpcCall(address, serviceMethod string, args any, reply any) error {
 func GrpcCall(address string, timeout int64) (pb.ServiceClient, context.Context, func(), error) {
 	var err error
 	GrpcCoonOnce.Do(func() {
-		GrpcCoon, err = grpc.Dial(address, grpc.WithInsecure(), grpc.WithKeepaliveParams(keepalive.ClientParameters{
-			Time:                10 * time.Second, // 发送ping的间隔
-			Timeout:             5 * time.Second,  // 等待pong响应的超时时间
-			PermitWithoutStream: true,             // 是否在没有活跃流的情况下发送pings
-		}))
+		//GrpcCoon, err = grpc.Dial(address, grpc.WithInsecure(), grpc.WithKeepaliveParams(keepalive.ClientParameters{
+		//	Time:                10 * time.Second, // 发送ping的间隔
+		//	Timeout:             5 * time.Second,  // 等待pong响应的超时时间
+		//	PermitWithoutStream: true,             // 是否在没有活跃流的情况下发送pings
+		//}))
+		GrpcCoon, err = grpc.Dial(address, grpc.WithInsecure())
 	})
 	var cancel context.CancelFunc
 	if err != nil {