Skip to content

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

:bug: https://github.com/siyuan-note/siyuan/issues/17716

Danielf0488af4b393
diff --git a/kernel/model/index.go b/kernel/model/index.go
index e2e9f66f38..700fc73ad8 100644
--- a/kernel/model/index.go
+++ b/kernel/model/index.go
@@ -377,6 +377,9 @@ func subscribeSQLEvents() {
return
}
+ if nil == context["current"] || nil == context["total"] {
+ return
+ }
current := context["current"].(int)
total := context["total"]
msg := fmt.Sprintf(Conf.Language(90), current, total, blockCount, hash)
@@ -388,6 +391,9 @@ func subscribeSQLEvents() {
return
}
+ if nil == context["current"] || nil == context["total"] {
+ return
+ }
current := context["current"].(int)
total := context["total"]
msg := fmt.Sprintf(Conf.Language(93), current, total, rootID)
@@ -399,6 +405,9 @@ func subscribeSQLEvents() {
return
}
+ if nil == context["current"] || nil == context["total"] {
+ return
+ }
current := context["current"].(int)
total := context["total"]
msg := fmt.Sprintf(Conf.Language(234), current, total, blockCount, hash)
@@ -411,6 +420,9 @@ func subscribeSQLEvents() {
return
}
+ if nil == context["current"] || nil == context["total"] {
+ return
+ }
current := context["current"].(int)
total := context["total"]
msg := fmt.Sprintf(Conf.Language(191), current, total)
@@ -423,6 +435,9 @@ func subscribeSQLEvents() {
return
}
+ if nil == context["current"] || nil == context["total"] {
+ return
+ }
current := context["current"].(int)
total := context["total"]
msg := fmt.Sprintf(Conf.Language(217), current, total)
diff --git a/kernel/sql/queue.go b/kernel/sql/queue.go
index 5c23a2e3d0..0af1ebb2a0 100644
--- a/kernel/sql/queue.go
+++ b/kernel/sql/queue.go
@@ -476,6 +476,7 @@ func processDiskQueue() {
luteEngine := lute.New()
context := map[string]any{eventbus.CtxPushMsg: eventbus.CtxPushMsgToStatusBar}
+ groupOpsCurrent := map[string]int{}
for _, e := range entries {
op := indexEntryToOp(e, luteEngine, "flush disk queue")
if nil == op {
@@ -485,6 +486,9 @@ func processDiskQueue() {
if err != nil {
return
}
+ groupOpsCurrent[op.action]++
+ context["current"] = groupOpsCurrent[op.action]
+ context["total"] = len(entries)
if err = execOp(op, tx, context); err != nil {
tx.Rollback()
closeTxPreparedStmts(tx)