🎨 改进已经损坏的数据处理 Fix https://github.com/siyuan-note/siyuan/issues/5853

This commit is contained in:
Liang Ding 2022-09-09 17:11:49 +08:00
parent 38c70f13a4
commit 8f3dd9fbf4
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
2 changed files with 25 additions and 9 deletions

View file

@ -92,8 +92,8 @@ func ListNotebooks() (ret []*Box, err error) {
continue
}
to := filepath.Join(util.WorkspaceDir, "corrupted", time.Now().Format("2006-01-02-150405"), dir.Name())
if renameErr := gulu.File.CopyDir(boxDirPath, to); nil != renameErr {
logging.LogErrorf("copy corrupted box [%s] failed: %s", boxDirPath, renameErr)
if copyErr := gulu.File.CopyDir(boxDirPath, to); nil != copyErr {
logging.LogErrorf("copy corrupted box [%s] failed: %s", boxDirPath, copyErr)
continue
}
if removeErr := os.RemoveAll(boxDirPath); nil != removeErr {