调整RPC通讯消息的最大尺寸

This commit is contained in:
刘祥超
2021-01-16 17:31:33 +08:00
parent 005761abeb
commit 701d1da0fa

View File

@@ -161,11 +161,11 @@ func (this *RPCClient) init() error {
}
var conn *grpc.ClientConn
if u.Scheme == "http" {
conn, err = grpc.Dial(u.Host, grpc.WithInsecure())
conn, err = grpc.Dial(u.Host, grpc.WithInsecure(), grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(128*1024*1024)))
} else if u.Scheme == "https" {
conn, err = grpc.Dial(u.Host, grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{
InsecureSkipVerify: true,
})))
})), grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(128*1024*1024)))
} else {
return errors.New("parse endpoint failed: invalid scheme '" + u.Scheme + "'")
}