🐛 Do not remove .tmp file when listing doc tree https://ld246.com/article/1702621572239

This commit is contained in:
Daniel 2023-12-15 19:37:59 +08:00
parent e9ef0611cd
commit 0547f27839
No known key found for this signature in database
GPG Key ID: 86211BA83DF03017

View File

@ -257,14 +257,6 @@ func (box *Box) Ls(p string) (ret []*FileInfo, totals int, err error) {
if util.IsReservedFilename(name) {
continue
}
if strings.HasSuffix(name, ".tmp") {
// 移除写入失败时产生的临时文件
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
}
totals += 1
fi := &FileInfo{}