🎨 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

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