1
0
mirror of https://github.com/haiwen/seafile-server.git synced 2025-04-28 03:20:10 +00:00

Only use tmpfiles dir for blocks (#730)

Co-authored-by: 杨赫然 <heran.yang@seafile.com>
This commit is contained in:
feiniks 2024-12-27 16:58:27 +08:00 committed by GitHub
parent db8c637c68
commit de62852244
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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
}