fix: UploadExists check needs to be before UploadCompleted call
This commit is contained in:
parent
82532b01eb
commit
bb41d70c10
|
@ -556,7 +556,6 @@ func (t *TusHandler) worker() {
|
||||||
}
|
}
|
||||||
|
|
||||||
mutex.(*sync.Mutex).Lock()
|
mutex.(*sync.Mutex).Lock()
|
||||||
err = t.UploadCompleted(ctx, info.Upload.ID)
|
|
||||||
exists, _ := t.UploadExists(ctx, decodedHash.HashBytes())
|
exists, _ := t.UploadExists(ctx, decodedHash.HashBytes())
|
||||||
if !exists {
|
if !exists {
|
||||||
mutex.(*sync.Mutex).Unlock()
|
mutex.(*sync.Mutex).Unlock()
|
||||||
|
@ -566,6 +565,7 @@ func (t *TusHandler) worker() {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
mutex.(*sync.Mutex).Unlock()
|
mutex.(*sync.Mutex).Unlock()
|
||||||
|
err = t.UploadCompleted(ctx, info.Upload.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.logger.Error("Could not complete tus upload", zap.Error(err))
|
t.logger.Error("Could not complete tus upload", zap.Error(err))
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in New Issue