🎨 改进内核任务调度机制提升稳定性 https://github.com/siyuan-note/siyuan/issues/7113

This commit is contained in:
Liang Ding 2023-01-26 20:57:52 +08:00
parent 13e6ff8557
commit f6d290bd61
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -519,6 +519,11 @@ func SaveBlockTree(force bool) {
})
blockTrees.Range(func(key, value interface{}) bool {
slice := value.(*btSlice)
if !force && (slice.changed.IsZero() || slice.changed.After(start.Add(-7*time.Second))) {
return true
}
waitGroup.Add(1)
p.Invoke(map[string]interface{}{"key": key, "value": value})
return true