fix: only process completed upload if its final

This commit is contained in:
Derrick Hammer 2024-01-22 17:49:42 -05:00
parent e0c6c88e75
commit 941ce27293
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 9 additions and 1 deletions

View File

@ -360,7 +360,15 @@ func (s *StorageServiceImpl) tusWorker() {
} }
case info := <-s.tus.CompleteUploads: case info := <-s.tus.CompleteUploads:
err := s.ScheduleTusUpload(info.Upload.ID, 0) if !info.Upload.IsFinal {
continue
}
err := s.TusUploadCompleted(info.Upload.ID)
if err != nil {
s.portal.Logger().Error("Could not complete tus upload", zap.Error(err))
continue
}
err = s.ScheduleTusUpload(info.Upload.ID, 0)
if err != nil { if err != nil {
s.portal.Logger().Error("Could not schedule tus upload", zap.Error(err)) s.portal.Logger().Error("Could not schedule tus upload", zap.Error(err))
continue continue