Skip to content

Commit

Permalink
object/nfs: delete and then create existing files (#4105)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhijian-pro authored Oct 20, 2023
1 parent 17668aa commit e875974
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/object/nfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ func (n *nfsStore) Put(key string, in io.Reader) error {
_ = n.mkdirAll(filepath.Dir(p), 0777)
_, err = n.target.Create(tmp, 0777)
}
if os.IsExist(err) {
_ = n.target.Remove(tmp)
_, err = n.target.Create(tmp, 0777)
}
if err != nil {
return errors.Wrapf(err, "create %s", tmp)
}
Expand Down

0 comments on commit e875974

Please sign in to comment.