From 385a43f5bdd37d9f223a9139f9169d0c370d7d56 Mon Sep 17 00:00:00 2001 From: Fedorov Vladimir Date: Thu, 1 Oct 2026 16:55:14 +0700 Subject: [PATCH] add ctx --- cmd/evening_detective_server/main.go | 1 + internal/modules/file_storage/storage.go | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/evening_detective_server/main.go b/cmd/evening_detective_server/main.go index f55f133..87d0b88 100644 --- a/cmd/evening_detective_server/main.go +++ b/cmd/evening_detective_server/main.go @@ -112,6 +112,7 @@ func main() { usersService := users_service.NewUsersService(usersRepo, passwordGenerator, emailSender, processorJWT, refreshTokensRepo, os.Getenv("APP_BASE_URL")) uiService := ui_service.NewUiService() fileStorage, err := file_storage.NewRustFSStorage( + context.Background(), os.Getenv("S3_HOST"), os.Getenv("S3_USER"), os.Getenv("S3_PASSWORD"), diff --git a/internal/modules/file_storage/storage.go b/internal/modules/file_storage/storage.go index bd7e7ba..fe03bbc 100644 --- a/internal/modules/file_storage/storage.go +++ b/internal/modules/file_storage/storage.go @@ -19,6 +19,7 @@ type storage struct { } func NewRustFSStorage( + ctx context.Context, endpoint string, accessKeyID string, secretAccessKey string, @@ -34,7 +35,7 @@ func NewRustFSStorage( return nil, err } - ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second) + ctx, cancel := context.WithTimeout(ctx, 3*time.Second) defer cancel() err = client.CreateBucket( ctx,