From 4950ea1c74e6b6c7bb1845f0961bc5fc2fd208d2 Mon Sep 17 00:00:00 2001 From: Steven Date: Tue, 7 May 2024 22:10:27 +0800 Subject: [PATCH] fix: grpc max message size --- server/server.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/server/server.go b/server/server.go index 27d0165e..da40e10f 100644 --- a/server/server.go +++ b/server/server.go @@ -69,10 +69,13 @@ func NewServer(ctx context.Context, profile *profile.Profile, store *store.Store // Create and register RSS routes. rss.NewRSSService(s.Profile, s.Store).RegisterRoutes(rootGroup) - grpcServer := grpc.NewServer(grpc.ChainUnaryInterceptor( - apiv1.NewLoggerInterceptor().LoggerInterceptor, - apiv1.NewGRPCAuthInterceptor(store, secret).AuthenticationInterceptor, - )) + grpcServer := grpc.NewServer( + // Override the maximum receiving message size to 100M for uploading large resources. + grpc.MaxRecvMsgSize(100*1024*1024), + grpc.ChainUnaryInterceptor( + apiv1.NewLoggerInterceptor().LoggerInterceptor, + apiv1.NewGRPCAuthInterceptor(store, secret).AuthenticationInterceptor, + )) s.grpcServer = grpcServer apiV1Service := apiv1.NewAPIV1Service(s.Secret, profile, store, grpcServer)