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

This commit is contained in:
Daniel 2023-12-08 22:35:04 +08:00
parent 8051f03ccc
commit a1a6fb513d
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
3 changed files with 7 additions and 9 deletions

View file

@ -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

View file

@ -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=

View file

@ -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++