mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-02 06:48:49 +01:00
🎨 改进内核任务调度机制提升稳定性 https://github.com/siyuan-note/siyuan/issues/7113
This commit is contained in:
parent
6649220283
commit
4916baf31a
8 changed files with 38 additions and 32 deletions
|
|
@ -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())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue