1
0
mirror of https://github.com/haiwen/seafile-server.git synced 2025-08-31 15:11:08 +00:00

Only use tmpfiles dir for blocks

This commit is contained in:
杨赫然
2024-12-23 16:46:54 +08:00
parent db8c637c68
commit 414beaa45c

View File

@@ -3,7 +3,6 @@ package objstore
import (
"io"
"io/ioutil"
"os"
"path"
)
@@ -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
}