1
0
mirror of https://github.com/haiwen/seafile-server.git synced 2025-09-04 17:00:35 +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 ( import (
"io" "io"
"io/ioutil"
"os" "os"
"path" "path"
) )
@@ -57,7 +56,11 @@ func (b *fsBackend) write(repoID string, objID string, r io.Reader, sync bool) e
return err 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 { if err != nil {
return err return err
} }