Skip to content

Commit

Permalink
[mod-misty] fix(drive): delete helper tmp file to avoid filling up he…
Browse files Browse the repository at this point in the history
…lper drive
  • Loading branch information
NyaMisty committed Jun 1, 2023
1 parent d65731d commit ee97025
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions backend/drive/drive.go
Original file line number Diff line number Diff line change
Expand Up @@ -2834,6 +2834,12 @@ func (f *Fs) PutUnchecked(ctx context.Context, in io.Reader, src fs.ObjectInfo,
if err != nil {
return nil, err
}
defer func() {
deleteErr := f.delete(ctx, info.Id, false)
if deleteErr != nil {
fs.Debugf("Cannot delete tmp upload file %s/%s: %v", tmpDriveID, info.Id, deleteErr)
}
}()
tmpFileObj, err := f.newObjectWithInfo(ctx, remote, info)
if err != nil {
return nil, err
Expand Down

0 comments on commit ee97025

Please sign in to comment.