Increase gRPC maximum message length

This commit is contained in:
Cody Soyland 2020-04-03 16:07:38 -05:00 committed by Cody Soyland
parent b7fcfb41d9
commit 0a86f6a97b

View file

@ -27,6 +27,8 @@ import (
"google.golang.org/grpc/credentials"
)
const maxMsgSize = 1024 * 1024 * 100 // 100 megs ought to be enough for anybody!
// GRPCClient is a client for working with the gRPC server.
type GRPCClient struct {
dialTarget string
@ -74,6 +76,8 @@ func (c *GRPCClient) resetConn() error {
opts = append(opts, grpc.WithInsecure())
}
opts = append(opts, grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(maxMsgSize)))
var err error
if c.conn, err = grpc.Dial(c.dialTarget, opts...); err != nil {
return errors.Wrap(err, "creating new grpc client")