From 0a86f6a97b46fa7900f7a8a8a1ccdc191cc18015 Mon Sep 17 00:00:00 2001 From: Cody Soyland Date: Fri, 3 Apr 2020 16:07:38 -0500 Subject: [PATCH] Increase gRPC maximum message length --- api/client/grpc.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/client/grpc.go b/api/client/grpc.go index 55c98f496..1c69e7b33 100644 --- a/api/client/grpc.go +++ b/api/client/grpc.go @@ -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")