🐛 更新或删除文档后立即点击重建索引导致死锁 Fix https://github.com/siyuan-note/siyuan/issues/5768

This commit is contained in:
Liang Ding 2022-08-31 12:48:49 +08:00
parent 7f9c598061
commit 46ed13a840
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
2 changed files with 5 additions and 1 deletions

View file

@ -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)

View file

@ -59,6 +59,10 @@ func init() {
func InitDatabase(forceRebuild bool) (err error) {
util.IncBootProgress(2, "Initializing database...")
if forceRebuild {
WaitForWritingDatabase()
}
initDBConnection()
if !forceRebuild {