From 1643dacdd40b5ad916a8e06ffbccbdecba3d1dd9 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Mon, 22 Jan 2024 18:53:31 -0500 Subject: [PATCH] refactor: store s3 client --- storage/storage.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/storage/storage.go b/storage/storage.go index 696d34e..a5d25f1 100644 --- a/storage/storage.go +++ b/storage/storage.go @@ -22,6 +22,7 @@ import ( "go.uber.org/zap" "io" "lukechampine.com/blake3" + "strings" "time" ) @@ -34,6 +35,7 @@ type StorageServiceImpl struct { httpApi *req.Client tus *tusd.Handler tusStore tusd.DataStore + s3Client *s3.Client } func (s *StorageServiceImpl) Tus() *tusd.Handler { @@ -204,7 +206,7 @@ func (s *StorageServiceImpl) Init() error { return blankResp, blankChanges, nil } - tus, store, err := s.BuildUploadBufferTus("/s5/upload/tus", preUpload, nil) + tus, store, s3client, err := s.BuildUploadBufferTus("/s5/upload/tus", preUpload, nil) if err != nil { return err @@ -212,6 +214,7 @@ func (s *StorageServiceImpl) Init() error { s.tus = tus s.tusStore = store + s.s3Client = s3client s.portal.CronService().RegisterService(s)