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

This commit is contained in:
Liang Ding 2023-01-24 21:50:10 +08:00
parent e8fe3a77b3
commit c5f4d3c780
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
19 changed files with 86 additions and 28 deletions

View file

@ -98,7 +98,6 @@ func newTask(action string, handler interface{}, args ...interface{}) *Task {
}
const (
CloudSync = "task.cloud.sync" // 数据同步
RepoCheckout = "task.repo.checkout" // 从快照中检出
DatabaseIndexFull = "task.database.index.full" // 重建索引
DatabaseIndex = "task.database.index" // 数据库索引队列
@ -120,8 +119,15 @@ func StatusLoop() {
continue
}
actionLangs := util.TaskActionLangs[util.Lang]
action := task.Action
if nil != actionLangs {
if label := actionLangs[task.Action]; nil != label {
action = label.(string)
}
}
item := map[string]interface{}{
"action": task.Action,
"action": action,
}
items = append(items, item)
}