Skip to content

Commit

Permalink
Bail out when upload files can not be removed
Browse files Browse the repository at this point in the history
  • Loading branch information
aduffeck committed Aug 3, 2022
1 parent 3249aa8 commit 0855632
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/storage/utils/decomposedfs/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,14 @@ func (fs *Decomposedfs) PurgeExpiredUploads(purgedChan chan<- tusd.FileInfo) err
}
if int64(expires) < time.Now().Unix() {
purgedChan <- info
os.Remove(info.Storage["BinPath"])
os.Remove(filepath.Join(fs.o.Root, "uploads", info.ID+".info"))
err = os.Remove(info.Storage["BinPath"])
if err != nil {
return err
}
err = os.Remove(filepath.Join(fs.o.Root, "uploads", info.ID+".info"))
if err != nil {
return err
}
}
}
return nil
Expand Down

0 comments on commit 0855632

Please sign in to comment.