🐛 更新或删除文档后立即点击重建索引导致死锁 Fix https://github.com/siyuan-note/siyuan/issues/5768
This commit is contained in:
parent
7f9c598061
commit
46ed13a840
2 changed files with 5 additions and 1 deletions
|
@ -476,13 +476,13 @@ func ReindexTree(path string) (err error) {
|
|||
func RefreshFileTree() {
|
||||
WaitForWritingFiles()
|
||||
|
||||
util.PushEndlessProgress(Conf.Language(35))
|
||||
if err := sql.InitDatabase(true); nil != err {
|
||||
util.PushErrMsg(fmt.Sprintf(Conf.Language(85), err), 5000)
|
||||
return
|
||||
}
|
||||
treenode.InitBlockTree(true)
|
||||
|
||||
util.PushEndlessProgress(Conf.Language(35))
|
||||
openedBoxes := Conf.GetOpenedBoxes()
|
||||
for _, openedBox := range openedBoxes {
|
||||
openedBox.Index(true)
|
||||
|
|
|
@ -59,6 +59,10 @@ func init() {
|
|||
func InitDatabase(forceRebuild bool) (err error) {
|
||||
util.IncBootProgress(2, "Initializing database...")
|
||||
|
||||
if forceRebuild {
|
||||
WaitForWritingDatabase()
|
||||
}
|
||||
|
||||
initDBConnection()
|
||||
|
||||
if !forceRebuild {
|
||||
|
|
Loading…
Add table
Reference in a new issue