mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 15:10:12 +01:00
🎨 改进同步后台任务
This commit is contained in:
parent
f3547465c1
commit
8d64ae6149
1 changed files with 9 additions and 7 deletions
|
|
@ -97,21 +97,23 @@ func StatusJob() {
|
||||||
tasks := taskQueue
|
tasks := taskQueue
|
||||||
data := map[string]interface{}{}
|
data := map[string]interface{}{}
|
||||||
var items []map[string]interface{}
|
var items []map[string]interface{}
|
||||||
|
count := map[string]int{}
|
||||||
for _, task := range tasks {
|
for _, task := range tasks {
|
||||||
if OCRImage == task.Action || DatabaseIndexEmbedBlock == task.Action {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
actionLangs := util.TaskActionLangs[util.Lang]
|
actionLangs := util.TaskActionLangs[util.Lang]
|
||||||
action := task.Action
|
action := task.Action
|
||||||
|
if c := count[action]; 3 < c {
|
||||||
|
logging.LogWarnf("too many tasks [%s], ignore show its status", action)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
count[action]++
|
||||||
|
|
||||||
if nil != actionLangs {
|
if nil != actionLangs {
|
||||||
if label := actionLangs[task.Action]; nil != label {
|
if label := actionLangs[task.Action]; nil != label {
|
||||||
action = label.(string)
|
action = label.(string)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
item := map[string]interface{}{
|
|
||||||
"action": action,
|
item := map[string]interface{}{"action": action}
|
||||||
}
|
|
||||||
items = append(items, item)
|
items = append(items, item)
|
||||||
}
|
}
|
||||||
if 1 > len(items) {
|
if 1 > len(items) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue