diff --git a/protocols/s5/tus.go b/protocols/s5/tus.go index a069751..f8ee3e3 100644 --- a/protocols/s5/tus.go +++ b/protocols/s5/tus.go @@ -556,7 +556,6 @@ func (t *TusHandler) worker() { } mutex.(*sync.Mutex).Lock() - err = t.UploadCompleted(ctx, info.Upload.ID) exists, _ := t.UploadExists(ctx, decodedHash.HashBytes()) if !exists { mutex.(*sync.Mutex).Unlock() @@ -566,6 +565,7 @@ func (t *TusHandler) worker() { continue } mutex.(*sync.Mutex).Unlock() + err = t.UploadCompleted(ctx, info.Upload.ID) if err != nil { t.logger.Error("Could not complete tus upload", zap.Error(err)) continue