mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-09 06:29:06 -05:00
🎨 改进内核任务调度机制提升稳定性 https://github.com/siyuan-note/siyuan/issues/7113
This commit is contained in:
@@ -29,6 +29,7 @@ import (
|
||||
"github.com/emirpasic/gods/sets/hashset"
|
||||
"github.com/siyuan-note/eventbus"
|
||||
"github.com/siyuan-note/logging"
|
||||
"github.com/siyuan-note/siyuan/kernel/task"
|
||||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
)
|
||||
|
||||
@@ -50,10 +51,10 @@ type treeQueueOperation struct {
|
||||
renameTreeOldHPath string // rename
|
||||
}
|
||||
|
||||
func AutoFlushTreeQueue() {
|
||||
func AutoFlushTx() {
|
||||
for {
|
||||
flushTreeQueue()
|
||||
time.Sleep(util.SQLFlushInterval)
|
||||
task.PrependTask(task.DatabaseIndex, FlushQueue)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,7 +92,7 @@ func ClearQueue() {
|
||||
operationQueue = nil
|
||||
}
|
||||
|
||||
func flushTreeQueue() {
|
||||
func FlushQueue() {
|
||||
ops := mergeUpsertTrees()
|
||||
if 1 > len(ops) {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user