Skip to content

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

:art: Improve kernel stability by eliminating some data races https://github.com/siyuan-note/siyuan/issues/9842

Daniela1a6fb513d91
diff --git a/kernel/go.mod b/kernel/go.mod
index ff098f38ff..27239306c4 100644
--- a/kernel/go.mod
+++ b/kernel/go.mod
@@ -50,7 +50,7 @@ require (
github.com/rqlite/sql v0.0.0-20221103124402-8f9ff0ceb8f0
github.com/sashabaranov/go-openai v1.17.9
github.com/shirou/gopsutil/v3 v3.23.11
- github.com/siyuan-note/dejavu v0.0.0-20231208085113-c89895f2a075
+ github.com/siyuan-note/dejavu v0.0.0-20231208142721-8ee5cca6b637
github.com/siyuan-note/encryption v0.0.0-20220713091850-5ecd92177b75
github.com/siyuan-note/eventbus v0.0.0-20230804030110-cf250f838c80
github.com/siyuan-note/filelock v0.0.0-20231206081043-b75b363ddb1b
diff --git a/kernel/go.sum b/kernel/go.sum
index 36b3a314ff..dc8c54c564 100644
--- a/kernel/go.sum
+++ b/kernel/go.sum
@@ -356,8 +356,8 @@ github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFR
github.com/shurcooL/gofontwoff v0.0.0-20181114050219-180f79e6909d h1:lvCTyBbr36+tqMccdGMwuEU+hjux/zL6xSmf5S9ITaA=
github.com/shurcooL/gofontwoff v0.0.0-20181114050219-180f79e6909d/go.mod h1:05UtEgK5zq39gLST6uB0cf3NEHjETfB4Fgr3Gx5R9Vw=
github.com/simplereach/timeutils v1.2.0/go.mod h1:VVbQDfN/FHRZa1LSqcwo4kNZ62OOyqLLGQKYB3pB0Q8=
-github.com/siyuan-note/dejavu v0.0.0-20231208085113-c89895f2a075 h1:AS4npSJSgBXGMR09USiPgdXmeaIJ02p5xFmPZjMNSTs=
-github.com/siyuan-note/dejavu v0.0.0-20231208085113-c89895f2a075/go.mod h1:JFtbncCYIJft4Krp7U8wdxfqmV7DzpVpfBwz/KGUjX4=
+github.com/siyuan-note/dejavu v0.0.0-20231208142721-8ee5cca6b637 h1:wn/tFUTCIpISY1l8IgDoAES7O3geASvnHHJJGY7snU8=
+github.com/siyuan-note/dejavu v0.0.0-20231208142721-8ee5cca6b637/go.mod h1:JFtbncCYIJft4Krp7U8wdxfqmV7DzpVpfBwz/KGUjX4=
github.com/siyuan-note/encryption v0.0.0-20220713091850-5ecd92177b75 h1:Bi7/7f29LW+Fm0cHc0J1NO1cZqyJwljSWVmfOqVZgaE=
github.com/siyuan-note/encryption v0.0.0-20220713091850-5ecd92177b75/go.mod h1:H8fyqqAbp9XreANjeSbc72zEdFfKTXYN34tc1TjZwtw=
github.com/siyuan-note/eventbus v0.0.0-20230804030110-cf250f838c80 h1:XghjHKJd+SiL0DkGYFVC+UGUDFtnR4v9gkAbPeh9Eq8=
diff --git a/kernel/model/repository.go b/kernel/model/repository.go
index 7f23922a9f..e6d62af535 100644
--- a/kernel/model/repository.go
+++ b/kernel/model/repository.go
@@ -1602,10 +1602,8 @@ func subscribeRepoEvents() {
})
eventbus.Subscribe(eventbus.EvtIndexUpsertFile, func(context map[string]interface{}, count int, total int) {
msg := fmt.Sprintf(Conf.Language(160), count, total)
- if 0 == count%64 {
- util.SetBootDetails(msg)
- util.ContextPushMsg(context, msg)
- }
+ util.SetBootDetails(msg)
+ util.ContextPushMsg(context, msg)
})
eventbus.Subscribe(eventbus.EvtCheckoutBeforeWalkData, func(context map[string]interface{}, path string) {
@@ -1616,7 +1614,7 @@ func subscribeRepoEvents() {
coWalkDataCount := 0
eventbus.Subscribe(eventbus.EvtCheckoutWalkData, func(context map[string]interface{}, path string) {
msg := fmt.Sprintf(Conf.Language(161), filepath.Base(path))
- if 0 == coWalkDataCount%1024 {
+ if 0 == coWalkDataCount%512 {
util.SetBootDetails(msg)
util.ContextPushMsg(context, msg)
}
@@ -1633,7 +1631,7 @@ func subscribeRepoEvents() {
eventbus.Subscribe(eventbus.EvtCheckoutUpsertFile, func(context map[string]interface{}, count, total int) {
msg := fmt.Sprintf(Conf.Language(162), count, total)
util.IncBootProgress(bootProgressPart, msg)
- if 0 == coUpsertFileCount%64 {
+ if 0 == coUpsertFileCount%32 {
util.ContextPushMsg(context, msg)
}
coUpsertFileCount++