mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
🎨 避免启动时重复全量重建索引 Fix https://github.com/siyuan-note/siyuan/issues/6950
This commit is contained in:
parent
99f16b2a7a
commit
40bbc6cc98
4 changed files with 7 additions and 7 deletions
|
|
@ -562,7 +562,7 @@ func FullReindex() {
|
||||||
openedBox.Index(true)
|
openedBox.Index(true)
|
||||||
}
|
}
|
||||||
IndexRefs()
|
IndexRefs()
|
||||||
treenode.SaveBlockTree()
|
treenode.SaveBlockTree(true)
|
||||||
InitFlashcards()
|
InitFlashcards()
|
||||||
|
|
||||||
util.PushEndlessProgress(Conf.Language(58))
|
util.PushEndlessProgress(Conf.Language(58))
|
||||||
|
|
|
||||||
|
|
@ -424,7 +424,7 @@ func Close(force bool, execInstallPkg int) (exitCode int) {
|
||||||
|
|
||||||
Conf.Close()
|
Conf.Close()
|
||||||
sql.CloseDatabase()
|
sql.CloseDatabase()
|
||||||
treenode.SaveBlockTree()
|
treenode.SaveBlockTree(false)
|
||||||
clearWorkspaceTemp()
|
clearWorkspaceTemp()
|
||||||
clearPortJSON()
|
clearPortJSON()
|
||||||
util.UnlockWorkspace()
|
util.UnlockWorkspace()
|
||||||
|
|
@ -601,7 +601,7 @@ func InitBoxes() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if !initialized {
|
if !initialized {
|
||||||
treenode.SaveBlockTree()
|
treenode.SaveBlockTree(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
var dbSize string
|
var dbSize string
|
||||||
|
|
|
||||||
|
|
@ -199,7 +199,7 @@ func Mount(boxID string) (alreadyMount bool, err error) {
|
||||||
IndexRefs()
|
IndexRefs()
|
||||||
// 缓存根一级的文档树展开
|
// 缓存根一级的文档树展开
|
||||||
ListDocTree(box.ID, "/", Conf.FileTree.Sort)
|
ListDocTree(box.ID, "/", Conf.FileTree.Sort)
|
||||||
treenode.SaveBlockTree()
|
treenode.SaveBlockTree(false)
|
||||||
util.ClearPushProgress(100)
|
util.ClearPushProgress(100)
|
||||||
if reMountGuide {
|
if reMountGuide {
|
||||||
return true, nil
|
return true, nil
|
||||||
|
|
|
||||||
|
|
@ -259,7 +259,7 @@ func IndexBlockTree(tree *parse.Tree) {
|
||||||
|
|
||||||
func AutoFlushBlockTree() {
|
func AutoFlushBlockTree() {
|
||||||
for {
|
for {
|
||||||
SaveBlockTree()
|
SaveBlockTree(false)
|
||||||
time.Sleep(7 * time.Second)
|
time.Sleep(7 * time.Second)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -307,8 +307,8 @@ func InitBlockTree(force bool) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func SaveBlockTree() {
|
func SaveBlockTree(force bool) {
|
||||||
if !blockTreesChanged {
|
if !force && !blockTreesChanged {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue