mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-26 02:06:10 +01:00
🎨 块树并发访问异常
This commit is contained in:
parent
a76cfb442c
commit
471089b6e9
1 changed files with 5 additions and 0 deletions
|
|
@ -59,6 +59,9 @@ func GetBlockTreeByPath(path string) *BlockTree {
|
|||
}
|
||||
|
||||
func CountTrees() (ret int) {
|
||||
blockTreesLock.Lock()
|
||||
defer blockTreesLock.Unlock()
|
||||
|
||||
roots := map[string]bool{}
|
||||
for _, b := range blockTrees {
|
||||
roots[b.RootID] = true
|
||||
|
|
@ -68,6 +71,8 @@ func CountTrees() (ret int) {
|
|||
}
|
||||
|
||||
func CountBlocks() (ret int) {
|
||||
blockTreesLock.Lock()
|
||||
defer blockTreesLock.Unlock()
|
||||
return len(blockTrees)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue