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

This commit is contained in:
Liang Ding 2023-01-25 22:58:25 +08:00
parent 4916baf31a
commit d7419e8029
No known key found for this signature in database
GPG Key ID: 136F30F901A2231D

View File

@ -19,12 +19,13 @@ package model
import (
"errors"
"fmt"
"github.com/siyuan-note/siyuan/kernel/task"
"time"
"github.com/88250/lute"
"github.com/88250/lute/ast"
"github.com/88250/lute/parse"
"github.com/siyuan-note/siyuan/kernel/sql"
"github.com/siyuan-note/siyuan/kernel/task"
"github.com/siyuan-note/siyuan/kernel/treenode"
"github.com/siyuan-note/siyuan/kernel/util"
)
@ -396,10 +397,16 @@ func getBlock(id string) (ret *Block, err error) {
if nil != err {
if task.ContainIndexTask() {
err = ErrIndexing
}
return
}
time.Sleep(1 * time.Second)
tree, err = loadTreeByBlockID(id)
if nil != err {
return
}
}
node := treenode.GetNodeInTree(tree, id)
sqlBlock := sql.BuildBlockFromNode(node, tree)
if nil == sqlBlock {