Skip to content

Commit

Permalink
Check for non existing file error
Browse files Browse the repository at this point in the history
  • Loading branch information
blmhemu committed Apr 24, 2024
1 parent 2dbe5f7 commit 13883dc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pkg/filestore/filestore.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,12 @@ func (upload *fileUpload) GetReader(ctx context.Context) (io.ReadCloser, error)
}

func (upload *fileUpload) Terminate(ctx context.Context) error {
// Ignore errors when removing bin to account for server crashes or force kills
// This can happen say if the server crashes just after removing the bin file
os.Remove(upload.binPath)
// Account for server crashes or force kills
// Say if the server crashes just after removing the bin file
err := os.Remove(upload.binPath)
if !os.IsNotExist(err) {
return err
}
return os.Remove(upload.infoPath)
}

Expand Down

0 comments on commit 13883dc

Please sign in to comment.