Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

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

Liang Dingd7419e80296e
diff --git a/kernel/model/block.go b/kernel/model/block.go
index 2ad01bf807..1cc22cabad 100644
--- a/kernel/model/block.go
+++ b/kernel/model/block.go
@@ -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,8 +397,14 @@ 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
}
- return
}
node := treenode.GetNodeInTree(tree, id)