This commit is contained in:
2026-08-28 23:01:48 +07:00
parent bbfca6d9a9
commit 3b15fb3a2b
2 changed files with 8 additions and 0 deletions
+8
View File
@@ -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)