mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-12 07:00:40 +08:00
🎨 改进内核任务调度机制提升稳定性 https://github.com/siyuan-note/siyuan/issues/7113
This commit is contained in:
parent
4916baf31a
commit
d7419e8029
@ -19,12 +19,13 @@ package model
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/siyuan-note/siyuan/kernel/task"
|
"time"
|
||||||
|
|
||||||
"github.com/88250/lute"
|
"github.com/88250/lute"
|
||||||
"github.com/88250/lute/ast"
|
"github.com/88250/lute/ast"
|
||||||
"github.com/88250/lute/parse"
|
"github.com/88250/lute/parse"
|
||||||
"github.com/siyuan-note/siyuan/kernel/sql"
|
"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/treenode"
|
||||||
"github.com/siyuan-note/siyuan/kernel/util"
|
"github.com/siyuan-note/siyuan/kernel/util"
|
||||||
)
|
)
|
||||||
@ -396,10 +397,16 @@ func getBlock(id string) (ret *Block, err error) {
|
|||||||
if nil != err {
|
if nil != err {
|
||||||
if task.ContainIndexTask() {
|
if task.ContainIndexTask() {
|
||||||
err = ErrIndexing
|
err = ErrIndexing
|
||||||
}
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
time.Sleep(1 * time.Second)
|
||||||
|
tree, err = loadTreeByBlockID(id)
|
||||||
|
if nil != err {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
node := treenode.GetNodeInTree(tree, id)
|
node := treenode.GetNodeInTree(tree, id)
|
||||||
sqlBlock := sql.BuildBlockFromNode(node, tree)
|
sqlBlock := sql.BuildBlockFromNode(node, tree)
|
||||||
if nil == sqlBlock {
|
if nil == sqlBlock {
|
||||||
|
Loading…
Reference in New Issue
Block a user