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

This commit is contained in:
Liang Ding 2023-01-18 23:15:00 +08:00
parent 2d94fd2b76
commit 0da0fb6712
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
2 changed files with 4 additions and 2 deletions

View file

@ -38,6 +38,7 @@ import (
"github.com/siyuan-note/siyuan/kernel/conf" "github.com/siyuan-note/siyuan/kernel/conf"
"github.com/siyuan-note/siyuan/kernel/search" "github.com/siyuan-note/siyuan/kernel/search"
"github.com/siyuan-note/siyuan/kernel/sql" "github.com/siyuan-note/siyuan/kernel/sql"
"github.com/siyuan-note/siyuan/kernel/task"
"github.com/siyuan-note/siyuan/kernel/treenode" "github.com/siyuan-note/siyuan/kernel/treenode"
"github.com/siyuan-note/siyuan/kernel/util" "github.com/siyuan-note/siyuan/kernel/util"
) )
@ -48,7 +49,7 @@ func AutoGenerateDocHistory() {
ChangeHistoryTick(Conf.Editor.GenerateHistoryInterval) ChangeHistoryTick(Conf.Editor.GenerateHistoryInterval)
for { for {
<-historyTicker.C <-historyTicker.C
generateDocHistory() task.PrependTask(task.HistoryGenerateDoc, generateDocHistory)
} }
} }

View file

@ -104,7 +104,8 @@ const (
DatabaseIndex = "task.database.index" // 数据库所以队列 DatabaseIndex = "task.database.index" // 数据库所以队列
DatabaseIndexFix = "task.database.index.fix" // 数据库索引订正 DatabaseIndexFix = "task.database.index.fix" // 数据库索引订正
OCRImage = "task.ocr.image" // 图片 OCR 提取文本 OCRImage = "task.ocr.image" // 图片 OCR 提取文本
DatabaseIndexEmbedBlock = "task.database.index.embedblock" // 数据库索引嵌入块 HistoryGenerateDoc = "task.history.generateDoc" // 生成文件历史
DatabaseIndexEmbedBlock = "task.database.index.embedBlock" // 数据库索引嵌入块
) )
func Loop() { func Loop() {