diff --git a/bin/evening_detective_server b/bin/evening_detective_server index 7f3f93d..6b87433 100755 Binary files a/bin/evening_detective_server and b/bin/evening_detective_server differ diff --git a/cmd/evening_detective_server/main.go b/cmd/evening_detective_server/main.go index bb36335..cc61238 100644 --- a/cmd/evening_detective_server/main.go +++ b/cmd/evening_detective_server/main.go @@ -47,6 +47,9 @@ import ( //go:embed main.swagger.json var swaggerJSON []byte +// maxFileSize — максимальный размер файла, передаваемого через gRPC +const maxFileSize = 64 << 20 // 64 МБ + func main() { _ = godotenv.Load() @@ -129,6 +132,7 @@ func main() { // Create a gRPC server object s := grpc.NewServer( + grpc.MaxRecvMsgSize(maxFileSize), grpc.UnaryInterceptor( processor_jwt.NewAuthorizationInterceptor( map[string]bool{ @@ -174,6 +178,10 @@ func main() { conn, err := grpc.NewClient( "0.0.0.0:8080", grpc.WithTransportCredentials(insecure.NewCredentials()), + grpc.WithDefaultCallOptions( + grpc.MaxCallSendMsgSize(maxFileSize), + grpc.MaxCallRecvMsgSize(maxFileSize), + ), ) if err != nil { log.Fatalln("Failed to dial server:", err)