An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:recycle: 改进后台任务判断重复
Liang Ding23df378a328d
diff --git a/kernel/model/tree.go b/kernel/model/tree.goindex 2fa88fc67e..2f7d53a9e5 100644--- a/kernel/model/tree.go+++ b/kernel/model/tree.go@@ -157,7 +157,7 @@ func loadTreeByBlockID(id string) (ret *parse.Tree, err error) {bt := treenode.GetBlockTree(id)if nil == bt {- if task.ContainIndexTask() {+ if task.ContainIndexTask(task.DatabaseIndex, task.DatabaseIndexFull) {err = ErrIndexingreturn}diff --git a/kernel/task/queue.go b/kernel/task/queue.goindex df55363416..a9731a7ac0 100644--- a/kernel/task/queue.go+++ b/kernel/task/queue.go@@ -18,12 +18,13 @@ package taskimport ("context"- "github.com/siyuan-note/siyuan/kernel/util""reflect""sync""time"+ "github.com/88250/gulu""github.com/siyuan-note/logging"+ "github.com/siyuan-note/siyuan/kernel/util")var (@@ -84,9 +85,12 @@ const (ReloadUI = "task.reload.ui" // 重载 UI)-func ContainIndexTask() bool {+func ContainIndexTask(action string, moreActions ...string) bool {+ actions := append(moreActions, action)+ actions = gulu.Str.RemoveDuplicatedElem(actions)+for _, task := range taskQueue {- if DatabaseIndex == task.Action || DatabaseIndexFull == task.Action {+ if gulu.Str.Contains(task.Action, actions) {return true}}