working commit
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user