Skip to content

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

:art: Improve query embed block auto refresh https://github.com/siyuan-note/siyuan/issues/14370

Daniel2a0034fa86c9
diff --git a/kernel/model/push_reload.go b/kernel/model/push_reload.go
index 8969018a4b..93b67637af 100644
--- a/kernel/model/push_reload.go
+++ b/kernel/model/push_reload.go
@@ -236,12 +236,6 @@ func refreshDynamicRefTexts(updatedDefNodes map[string]*ast.Node, updatedTrees m
switch defNode.refType {
case "ref-d":
task.AppendAsyncTaskWithDelay(task.SetRefDynamicText, 200*time.Millisecond, util.PushSetRefDynamicText, refTreeID, n.ID, defNode.id, defNode.refText)
- case "embed":
- go func() {
- time.Sleep(100 * time.Millisecond)
- sql.FlushQueue()
- task.AppendAsyncTaskWithDelay(task.ReloadEmbedBlock, 200*time.Millisecond, util.PushReloadEmbedBlock, refTreeID, n.ID)
- }()
}
}
return ast.WalkContinue
diff --git a/kernel/task/queue.go b/kernel/task/queue.go
index 13fe7ad02f..184275b9d5 100644
--- a/kernel/task/queue.go
+++ b/kernel/task/queue.go
@@ -138,7 +138,6 @@ const (
ReloadProtyle = "task.reload.protyle" // 重新加载编辑器
SetRefDynamicText = "task.ref.setDynamicText" // 设置引用的动态锚文本
SetDefRefCount = "task.def.setRefCount" // 设置定义的引用计数
- ReloadEmbedBlock = "task.ref.reloadEmbedBlock" // 重新加载嵌入块
UpdateIDs = "task.update.ids" // 更新 ID
PushMsg = "task.push.msg" // 推送消息
)
@@ -159,7 +158,6 @@ var uniqueActions = []string{
ReloadProtyle,
SetRefDynamicText,
SetDefRefCount,
- ReloadEmbedBlock,
UpdateIDs,
}
diff --git a/kernel/util/websocket.go b/kernel/util/websocket.go
index e5da158bec..954c427ed2 100644
--- a/kernel/util/websocket.go
+++ b/kernel/util/websocket.go
@@ -275,10 +275,6 @@ func PushSetDefRefCount(rootID, blockID string, defIDs []string, refCount, rootR
BroadcastByType("main", "setDefRefCount", 0, "", map[string]interface{}{"rootID": rootID, "blockID": blockID, "refCount": refCount, "rootRefCount": rootRefCount, "defIDs": defIDs})
}
-func PushReloadEmbedBlock(rootID, embedBlockID string) {
- BroadcastByType("main", "reloadEmbedBlock", 0, "", map[string]interface{}{"rootID": rootID, "embedBlockID": embedBlockID})
-}
-
func PushProtyleLoading(rootID, msg string) {
BroadcastByType("protyle", "addLoading", 0, msg, rootID)
}