mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-24 10:30:13 +01:00
🎨 数据统计
This commit is contained in:
parent
70490f3e16
commit
953ce38ab7
7 changed files with 51 additions and 12 deletions
|
|
@ -71,6 +71,19 @@ func CountBlocks() (ret int) {
|
|||
return len(blockTrees)
|
||||
}
|
||||
|
||||
func CeilCount(count int) int {
|
||||
if 100 > count {
|
||||
return 100
|
||||
}
|
||||
|
||||
for i := 1; i < 40; i++ {
|
||||
if count < i*500 {
|
||||
return i * 500
|
||||
}
|
||||
}
|
||||
return 500*40 + 1
|
||||
}
|
||||
|
||||
func GetBlockTreeRootByPath(boxID, path string) *BlockTree {
|
||||
blockTreesLock.Lock()
|
||||
defer blockTreesLock.Unlock()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue