mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 18:10:12 +01:00
🐛 更新或删除文档后立即点击重建索引导致死锁 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() {
|
func RefreshFileTree() {
|
||||||
WaitForWritingFiles()
|
WaitForWritingFiles()
|
||||||
|
|
||||||
|
util.PushEndlessProgress(Conf.Language(35))
|
||||||
if err := sql.InitDatabase(true); nil != err {
|
if err := sql.InitDatabase(true); nil != err {
|
||||||
util.PushErrMsg(fmt.Sprintf(Conf.Language(85), err), 5000)
|
util.PushErrMsg(fmt.Sprintf(Conf.Language(85), err), 5000)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
treenode.InitBlockTree(true)
|
treenode.InitBlockTree(true)
|
||||||
|
|
||||||
util.PushEndlessProgress(Conf.Language(35))
|
|
||||||
openedBoxes := Conf.GetOpenedBoxes()
|
openedBoxes := Conf.GetOpenedBoxes()
|
||||||
for _, openedBox := range openedBoxes {
|
for _, openedBox := range openedBoxes {
|
||||||
openedBox.Index(true)
|
openedBox.Index(true)
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,10 @@ func init() {
|
||||||
func InitDatabase(forceRebuild bool) (err error) {
|
func InitDatabase(forceRebuild bool) (err error) {
|
||||||
util.IncBootProgress(2, "Initializing database...")
|
util.IncBootProgress(2, "Initializing database...")
|
||||||
|
|
||||||
|
if forceRebuild {
|
||||||
|
WaitForWritingDatabase()
|
||||||
|
}
|
||||||
|
|
||||||
initDBConnection()
|
initDBConnection()
|
||||||
|
|
||||||
if !forceRebuild {
|
if !forceRebuild {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue