From df13f7b187723a595ef600162f031caba06887dd Mon Sep 17 00:00:00 2001 From: Andrey Date: Wed, 10 Jul 2024 18:29:47 +0300 Subject: [PATCH] Fix missing close. --- storage/factory.go | 2 ++ storage/gcp_storage.go | 4 ++++ version/version.go | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/storage/factory.go b/storage/factory.go index bb45540..db8480f 100644 --- a/storage/factory.go +++ b/storage/factory.go @@ -13,10 +13,12 @@ import ( func NewStorage(storageType, basePath string) (Storer, error) { switch storageType { case "filesystem": + log.Println("Using filesystem storage") return NewFileStorage(basePath), nil case "gcp-storage": // Google Cloud Storage ctx := context.Background() + log.Println("Creating GCS client") var client *gcp_storage.Client var clientErr error diff --git a/storage/gcp_storage.go b/storage/gcp_storage.go index 0156949..1488ce1 100644 --- a/storage/gcp_storage.go +++ b/storage/gcp_storage.go @@ -47,6 +47,10 @@ func (g *GCS) Save(batchDir, filename string, bf bytes.Buffer) error { return fmt.Errorf("failed to write object to bucket: %v", err) } + if err := wc.Close(); err != nil { + return fmt.Errorf("failed to close writer: %v", err) + } + return nil } diff --git a/version/version.go b/version/version.go index 0f9aea7..b30461b 100644 --- a/version/version.go +++ b/version/version.go @@ -1,3 +1,3 @@ package version -var SeerVersion string = "0.1.8" +var SeerVersion string = "0.1.9"