working commit

This commit is contained in:
2026-03-12 18:02:10 +02:00
parent 27c912d266
commit 920423ffeb
4 changed files with 45 additions and 25 deletions
+2 -2
View File
@@ -78,7 +78,7 @@ func (store *Storage) WriteTempFile(source io.Reader) (string, int64, string, er
var size int64
var csum string
tmpName := fmt.Sprintf("%d.tmp", auxuuid.NewUUID())
tmpName := fmt.Sprintf("%s.tmp", auxuuid.NewUUID())
tmpPath := store.makeTmppath(tmpName)
tmpdirpath := store.makeTmpsubdir()
@@ -120,7 +120,7 @@ func (store *Storage) HardlinkFile(tmpName, collection, filename string) error {
}
filename = store.makeFilepath(collection, filename)
_, err = os.Stat(dirname)
if os.IsExist(err) {
if err == nil {
os.Remove(filename) // TODO: safe removing
}
tmpName = store.makeTmppath(tmpName)