Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

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

Daniel50eef7d1e620
diff --git a/kernel/model/tree.go b/kernel/model/tree.go
index aede8e6c5a..54f98d8500 100644
--- a/kernel/model/tree.go
+++ b/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)
}