Skip to content

Commit

Permalink
Only use tmpfiles dir for blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
杨赫然 committed Dec 23, 2024
1 parent db8c637 commit 414beaa
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions fileserver/objstore/backend_fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package objstore

import (
"io"
"io/ioutil"
"os"
"path"
)
Expand Down Expand Up @@ -57,7 +56,11 @@ func (b *fsBackend) write(repoID string, objID string, r io.Reader, sync bool) e
return err
}

tFile, err := ioutil.TempFile(b.tmpDir, objID)
tmpDir := b.tmpDir
if b.objType != "blocks" {
tmpDir = parentDir
}
tFile, err := os.CreateTemp(tmpDir, objID+".*")
if err != nil {
return err
}
Expand Down

0 comments on commit 414beaa

Please sign in to comment.