Skip to content

Commit 54c6370

Browse files
committed
feature(grpc): allow the configuration of GRPC default MaxRecvMessageSize
Signed-off-by: vibe <[email protected]>
1 parent b6b56a6 commit 54c6370

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

main.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ type CLI struct {
1515
Address string `help:"Address at which to listen for gRPC connections." default:":9443"`
1616
TLSCertsDir string `help:"Directory containing server certs (tls.key, tls.crt) and the CA used to verify client certificates (ca.crt)" env:"TLS_SERVER_CERTS_DIR"`
1717
Insecure bool `help:"Run without mTLS credentials. If you supply this flag --tls-server-certs-dir will be ignored."`
18+
MaxRecvMessageSize int `help:"Maximum size of received messages in MB." default:"4"`
19+
1820
}
1921

2022
// Run this Function.
@@ -27,7 +29,8 @@ func (c *CLI) Run() error {
2729
return function.Serve(&Function{log: log},
2830
function.Listen(c.Network, c.Address),
2931
function.MTLSCertificates(c.TLSCertsDir),
30-
function.Insecure(c.Insecure))
32+
function.Insecure(c.Insecure),
33+
function.MaxRecvMessageSize(c.MaxRecvMessageSize * 1024 * 1024))
3134
}
3235

3336
func main() {

0 commit comments

Comments
 (0)