Skip to content

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

:zap: Improve recent docs loading performance Fix https://github.com/siyuan-note/siyuan/issues/11977

Danieleb0879812fda
diff --git a/kernel/model/storage.go b/kernel/model/storage.go
index 7716f990e6..d0836a5a87 100644
--- a/kernel/model/storage.go
+++ b/kernel/model/storage.go
@@ -140,9 +140,14 @@ func getRecentDocs() (ret []*RecentDoc, err error) {
return
}
+ var rootIDs []string
+ for _, doc := range tmp {
+ rootIDs = append(rootIDs, doc.RootID)
+ }
+ bts := treenode.GetBlockTrees(rootIDs)
var notExists []string
for _, doc := range tmp {
- if bt := treenode.GetBlockTree(doc.RootID); nil != bt {
+ if bt := bts[doc.RootID]; nil != bt {
doc.Title = path.Base(bt.HPath) // Recent docs not updated after renaming https://github.com/siyuan-note/siyuan/issues/7827
ret = append(ret, doc)
} else {