mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 Improve boot logging for database
This commit is contained in:
parent
2d8152381c
commit
c925f06326
4 changed files with 20 additions and 7 deletions
|
|
@ -29,7 +29,6 @@ import (
|
|||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/88250/go-humanize"
|
||||
"github.com/88250/gulu"
|
||||
"github.com/88250/lute"
|
||||
"github.com/88250/lute/ast"
|
||||
|
|
@ -834,7 +833,8 @@ func (conf *AppConf) language(num int) (ret string) {
|
|||
}
|
||||
|
||||
func InitBoxes() {
|
||||
initialized := 0 < treenode.CountBlocks()
|
||||
blockCount := treenode.CountBlocks()
|
||||
initialized := 0 < blockCount
|
||||
for _, box := range Conf.GetOpenedBoxes() {
|
||||
box.UpdateHistoryGenerated() // 初始化历史生成时间为当前时间
|
||||
|
||||
|
|
@ -843,11 +843,7 @@ func InitBoxes() {
|
|||
}
|
||||
}
|
||||
|
||||
var dbSize string
|
||||
if dbFile, err := os.Stat(util.DBPath); err == nil {
|
||||
dbSize = humanize.BytesCustomCeil(uint64(dbFile.Size()), 2)
|
||||
}
|
||||
logging.LogInfof("database size [%s], tree/block count [%d/%d]", dbSize, treenode.CountTrees(), treenode.CountBlocks())
|
||||
logging.LogInfof("tree/block count [%d/%d]", treenode.CountTrees(), blockCount)
|
||||
}
|
||||
|
||||
func IsSubscriber() bool {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue