mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-04 05:11:03 +08:00
🎨 boot log
This commit is contained in:
parent
5139e51165
commit
1ea657430a
@ -491,8 +491,7 @@ func (conf *AppConf) Language(num int) (ret string) {
|
|||||||
|
|
||||||
func InitBoxes() {
|
func InitBoxes() {
|
||||||
initialized := false
|
initialized := false
|
||||||
blockCount := 0
|
if 1 > treenode.CountBlocks() {
|
||||||
if 1 > len(treenode.GetBlockTrees()) {
|
|
||||||
if gulu.File.IsExist(util.BlockTreePath) {
|
if gulu.File.IsExist(util.BlockTreePath) {
|
||||||
util.IncBootProgress(20, "Reading block trees...")
|
util.IncBootProgress(20, "Reading block trees...")
|
||||||
go func() {
|
go func() {
|
||||||
@ -523,14 +522,11 @@ func InitBoxes() {
|
|||||||
treenode.SaveBlockTree()
|
treenode.SaveBlockTree()
|
||||||
}
|
}
|
||||||
|
|
||||||
blocktrees := treenode.GetBlockTrees()
|
|
||||||
blockCount = len(blocktrees)
|
|
||||||
|
|
||||||
var dbSize string
|
var dbSize string
|
||||||
if dbFile, err := os.Stat(util.DBPath); nil == err {
|
if dbFile, err := os.Stat(util.DBPath); nil == err {
|
||||||
dbSize = humanize.Bytes(uint64(dbFile.Size()))
|
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 {
|
func IsSubscriber() bool {
|
||||||
|
@ -56,8 +56,8 @@ func CountTrees() (ret int) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetBlockTrees() map[string]*BlockTree {
|
func CountBlocks() (ret int) {
|
||||||
return blockTrees
|
return len(blockTrees)
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetBlockTreeRootByPath(boxID, path string) *BlockTree {
|
func GetBlockTreeRootByPath(boxID, path string) *BlockTree {
|
||||||
|
Loading…
Reference in New Issue
Block a user