🎨 改进块树索引
This commit is contained in:
parent
57a3188f4c
commit
8c6b10a02b
1 changed files with 9 additions and 2 deletions
|
@ -305,9 +305,13 @@ func updateBtSlice(n *ast.Node, tree *parse.Tree) {
|
|||
slice.m.Unlock()
|
||||
}
|
||||
|
||||
func InitBlockTree(force bool) {
|
||||
start := time.Now()
|
||||
var blockTreeLock = sync.Mutex{}
|
||||
|
||||
func InitBlockTree(force bool) {
|
||||
blockTreeLock.Lock()
|
||||
defer blockTreeLock.Unlock()
|
||||
|
||||
start := time.Now()
|
||||
if force {
|
||||
err := os.RemoveAll(util.BlockTreePath)
|
||||
if nil != err {
|
||||
|
@ -387,6 +391,9 @@ func SaveBlockTreeJob() {
|
|||
}
|
||||
|
||||
func SaveBlockTree(force bool) {
|
||||
blockTreeLock.Lock()
|
||||
defer blockTreeLock.Unlock()
|
||||
|
||||
start := time.Now()
|
||||
os.MkdirAll(util.BlockTreePath, 0755)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue