Merge pull request #2380 from dmcgowan/ignore-zero-msg-size-configs
Ignore zero max message size in grpc config
This commit is contained in:
commit
b867977c01
@ -66,12 +66,18 @@ func New(ctx context.Context, config *Config) (*Server, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
rpc := grpc.NewServer(
|
|
||||||
grpc.MaxRecvMsgSize(config.GRPC.MaxRecvMsgSize),
|
serverOpts := []grpc.ServerOption{
|
||||||
grpc.MaxSendMsgSize(config.GRPC.MaxSendMsgSize),
|
|
||||||
grpc.UnaryInterceptor(grpc_prometheus.UnaryServerInterceptor),
|
grpc.UnaryInterceptor(grpc_prometheus.UnaryServerInterceptor),
|
||||||
grpc.StreamInterceptor(grpc_prometheus.StreamServerInterceptor),
|
grpc.StreamInterceptor(grpc_prometheus.StreamServerInterceptor),
|
||||||
)
|
}
|
||||||
|
if config.GRPC.MaxRecvMsgSize > 0 {
|
||||||
|
serverOpts = append(serverOpts, grpc.MaxRecvMsgSize(config.GRPC.MaxRecvMsgSize))
|
||||||
|
}
|
||||||
|
if config.GRPC.MaxSendMsgSize > 0 {
|
||||||
|
serverOpts = append(serverOpts, grpc.MaxSendMsgSize(config.GRPC.MaxSendMsgSize))
|
||||||
|
}
|
||||||
|
rpc := grpc.NewServer(serverOpts...)
|
||||||
var (
|
var (
|
||||||
services []plugin.Service
|
services []plugin.Service
|
||||||
s = &Server{
|
s = &Server{
|
||||||
|
Loading…
Reference in New Issue
Block a user