🎨 不再自动从临时文件中恢复数据文件 Fix https://github.com/siyuan-note/siyuan/issues/7260

This commit is contained in:
Liang Ding 2023-02-05 11:11:32 +08:00
parent e7f2fb9c9c
commit ae9ba8496f
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
3 changed files with 5 additions and 86 deletions

View file

@ -245,7 +245,10 @@ func (box *Box) Ls(p string) (ret []*FileInfo, totals int, err error) {
}
if strings.HasSuffix(name, ".tmp") {
// 移除写入失败时产生的临时文件
os.Remove(filepath.Join(util.DataDir, box.ID, p, name))
removePath := filepath.Join(util.DataDir, box.ID, p, name)
if removeErr := os.Remove(removePath); nil != removeErr {
logging.LogWarnf("remove tmp file [%s] failed: %s", removePath, removeErr)
}
continue
}