Skip to content

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

:art: boot log

Liang Ding1ea657430a05
diff --git a/kernel/model/conf.go b/kernel/model/conf.go
index 31e15186e2..82ed35f03f 100644
--- a/kernel/model/conf.go
+++ b/kernel/model/conf.go
@@ -491,8 +491,7 @@ func (conf *AppConf) Language(num int) (ret string) {
func InitBoxes() {
initialized := false
- blockCount := 0
- if 1 > len(treenode.GetBlockTrees()) {
+ if 1 > treenode.CountBlocks() {
if gulu.File.IsExist(util.BlockTreePath) {
util.IncBootProgress(20, "Reading block trees...")
go func() {
@@ -523,14 +522,11 @@ func InitBoxes() {
treenode.SaveBlockTree()
}
- blocktrees := treenode.GetBlockTrees()
- blockCount = len(blocktrees)
-
var dbSize string
if dbFile, err := os.Stat(util.DBPath); nil == err {
dbSize = humanize.Bytes(uint64(dbFile.Size()))
}
- logging.LogInfof("database size [%s], block count [%d]", dbSize, blockCount)
+ logging.LogInfof("database size [%s], tree/block count [%d/%d]", dbSize, treenode.CountTrees(), treenode.CountBlocks())
}
func IsSubscriber() bool {
diff --git a/kernel/treenode/blocktree.go b/kernel/treenode/blocktree.go
index 455484c6fa..fe9f50d84e 100644
--- a/kernel/treenode/blocktree.go
+++ b/kernel/treenode/blocktree.go
@@ -56,8 +56,8 @@ func CountTrees() (ret int) {
return
}
-func GetBlockTrees() map[string]*BlockTree {
- return blockTrees
+func CountBlocks() (ret int) {
+ return len(blockTrees)
}
func GetBlockTreeRootByPath(boxID, path string) *BlockTree {