refactor: store s3 client

This commit is contained in:
Derrick Hammer 2024-01-22 18:53:31 -05:00
parent 0eb67cd8da
commit 1643dacdd4
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 4 additions and 1 deletions

View File

@ -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)