Преглед изворни кода

:art: Automatically loads and indexes from the file system when a block is not found https://github.com/siyuan-note/siyuan/issues/10772

Daniel пре 1 година
родитељ
комит
50eef7d1e6
1 измењених фајлова са 3 додато и 0 уклоњено
  1. 3 0
      kernel/model/tree.go

+ 3 - 0
kernel/model/tree.go

@@ -181,6 +181,7 @@ func searchTreeInFilesystem(rootID string) {
 	msdID := util.PushMsg(Conf.language(45), 7000)
 	defer util.PushClearMsg(msdID)
 
+	logging.LogWarnf("searching tree on filesystem [rootID=%s]", rootID)
 	var treePath string
 	filepath.Walk(util.DataDir, func(path string, info fs.FileInfo, err error) error {
 		if info.IsDir() {
@@ -204,6 +205,7 @@ func searchTreeInFilesystem(rootID string) {
 	})
 
 	if "" == treePath {
+		logging.LogErrorf("tree not found on filesystem [rootID=%s]", rootID)
 		return
 	}
 
@@ -224,4 +226,5 @@ func searchTreeInFilesystem(rootID string) {
 	treenode.IndexBlockTree(tree)
 	sql.IndexTreeQueue(tree)
 	sql.WaitForWritingDatabase()
+	logging.LogInfof("reindexed tree by filesystem [rootID=%s]", rootID)
 }