Skip to content

Commit

Permalink
fix: increase max grpc stream size
Browse files Browse the repository at this point in the history
Signed-off-by: QuentinN42 <[email protected]>
  • Loading branch information
QuentinN42 committed Oct 20, 2023
1 parent e91f4df commit 5154701
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pkg/grpc/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import (
"google.golang.org/grpc/credentials/insecure"
)

var maxMsgSize = 1024 * 1024 * 1024

func GetCon(url string) *grpc.ClientConn {
var creds grpc.DialOption
if strings.Split(url, ":")[0] == "localhost" {
Expand All @@ -25,7 +27,14 @@ func GetCon(url string) *grpc.ClientConn {
})
creds = grpc.WithTransportCredentials(cred)
}
con, err := grpc.Dial(url, creds)
con, err := grpc.Dial(
url,
creds,
grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(maxMsgSize),
grpc.MaxCallSendMsgSize(maxMsgSize),
),
)
if err != nil {
log.Fatalf("Error connecting: %v \n", err)
}
Expand Down
1 change: 1 addition & 0 deletions pkg/roundtrip/roudtrip.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ func HandleRequest(protoReq *proto.Request) *proto.Response {
logger.Error("ERROR sending request : %v", err)
return protoErr(599, protoReq.Correlation)
}
logger.Debug("Received response code %d (%v)", httpRes.StatusCode, protoReq.Correlation)

protoRes, err := responseToTransport(httpRes, protoReq.Correlation)
if err != nil {
Expand Down

0 comments on commit 5154701

Please sign in to comment.