mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-21 15:56:10 +01:00
This commit is contained in:
parent
0b43582f69
commit
490d8da62e
1 changed files with 1 additions and 11 deletions
|
|
@ -112,18 +112,8 @@ func ListNotebooks() (ret []*Box, err error) {
|
|||
boxDirPath := filepath.Join(util.DataDir, dir.Name())
|
||||
boxConfPath := filepath.Join(boxDirPath, ".siyuan", "conf.json")
|
||||
if !filelock.IsExist(boxConfPath) {
|
||||
// Automatically move corrupted notebook folders to the corrupted folder https://github.com/siyuan-note/siyuan/issues/9202
|
||||
// 数据同步时展开文档树操作可能导致数据丢失 https://github.com/siyuan-note/siyuan/issues/7129
|
||||
logging.LogWarnf("found a corrupted box [%s]", boxDirPath)
|
||||
to := filepath.Join(util.WorkspaceDir, "corrupted", time.Now().Format("2006-01-02-150405"), dir.Name())
|
||||
if copyErr := filelock.Copy(boxDirPath, to); nil != copyErr {
|
||||
logging.LogErrorf("copy corrupted notebook dir [%s] failed: %s", boxDirPath, copyErr)
|
||||
continue
|
||||
}
|
||||
if removeErr := filelock.Remove(boxDirPath); nil != removeErr {
|
||||
logging.LogErrorf("remove corrupted data file [%s] failed: %s", boxDirPath, removeErr)
|
||||
continue
|
||||
}
|
||||
util.ReloadUI()
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue