mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-28 12:28:48 +01:00
🎨 数据同步时展开文档树操作可能导致数据丢失 https://github.com/siyuan-note/siyuan/issues/7129
This commit is contained in:
parent
b1cccc1639
commit
e2fc3f442c
1 changed files with 1 additions and 14 deletions
|
|
@ -696,20 +696,7 @@ func clearCorruptedNotebooks() {
|
|||
boxDirPath := filepath.Join(util.DataDir, dir.Name())
|
||||
boxConfPath := filepath.Join(boxDirPath, ".siyuan", "conf.json")
|
||||
if !gulu.File.IsExist(boxConfPath) {
|
||||
if IsUserGuide(dir.Name()) {
|
||||
filelock.Remove(boxDirPath)
|
||||
continue
|
||||
}
|
||||
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 box [%s] failed: %s", boxDirPath, copyErr)
|
||||
continue
|
||||
}
|
||||
if removeErr := filelock.Remove(boxDirPath); nil != removeErr {
|
||||
logging.LogErrorf("remove corrupted box [%s] failed: %s", boxDirPath, removeErr)
|
||||
continue
|
||||
}
|
||||
logging.LogWarnf("moved corrupted box [%s] to [%s]", boxDirPath, to)
|
||||
logging.LogWarnf("found a corrupted box [%s]", boxDirPath)
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue