Skip to content

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

:art: Improve the status bar index creation information prompt https://github.com/siyuan-note/siyuan/issues/15390

Daniel55bc708582a2
diff --git a/kernel/model/box.go b/kernel/model/box.go
index 2d2e5742f3..2ad64abe9f 100644
--- a/kernel/model/box.go
+++ b/kernel/model/box.go
@@ -677,10 +677,10 @@ func FullReindex() {
}
func fullReindex() {
- pushSQLInsertBlocksFTSMsg = true
+ pushSQLInsertBlocksFTSMsg, pushSQLDeleteBlocksMsg = true, true
defer func() {
sql.FlushQueue()
- pushSQLInsertBlocksFTSMsg = false
+ pushSQLInsertBlocksFTSMsg, pushSQLDeleteBlocksMsg = false, false
}()
util.PushEndlessProgress(Conf.language(35))
diff --git a/kernel/model/index.go b/kernel/model/index.go
index ab8d64ccb3..7be4db96d8 100644
--- a/kernel/model/index.go
+++ b/kernel/model/index.go
@@ -359,7 +359,10 @@ func init() {
subscribeSQLEvents()
}
-var pushSQLInsertBlocksFTSMsg bool
+var (
+ pushSQLInsertBlocksFTSMsg bool
+ pushSQLDeleteBlocksMsg bool
+)
func subscribeSQLEvents() {
// 使用下面的 EvtSQLInsertBlocksFTS 就可以了
@@ -371,8 +374,6 @@ func subscribeSQLEvents() {
//})
eventbus.Subscribe(eventbus.EvtSQLInsertBlocksFTS, func(context map[string]interface{}, blockCount int, hash string) {
if !pushSQLInsertBlocksFTSMsg {
- // 如果不是全量重建索引,则不显示进度信息
- // Improve status bar index creation information prompt https://github.com/siyuan-note/siyuan/issues/15390
return
}
@@ -383,7 +384,7 @@ func subscribeSQLEvents() {
util.ContextPushMsg(context, msg)
})
eventbus.Subscribe(eventbus.EvtSQLDeleteBlocks, func(context map[string]interface{}, rootID string) {
- if util.ContainerAndroid == util.Container || util.ContainerIOS == util.Container || util.ContainerHarmony == util.Container {
+ if !pushSQLDeleteBlocksMsg {
return
}