🎨 改进内核任务调度机制提升稳定性 https://github.com/siyuan-note/siyuan/issues/7113

This commit is contained in:
Liang Ding 2023-01-25 22:54:29 +08:00
parent 6649220283
commit 4916baf31a
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
8 changed files with 38 additions and 32 deletions

View file

@ -52,27 +52,12 @@ func (box *Box) Index() {
task.AppendTask(task.DatabaseIndexRef, IndexRefs)
}
var indexing = false
func isIndexing() (ret bool) {
for i := 0; indexing || i > 7; i++ {
time.Sleep(time.Millisecond * 100)
ret = true
}
return
}
func index(boxID string) {
box := Conf.Box(boxID)
if nil == box {
return
}
indexing = true
defer func() {
indexing = false
}()
util.SetBootDetails("Listing files...")
files := box.ListFiles("/")
boxLen := len(Conf.GetOpenedBoxes())