🎨 改进状态栏显示后台任务执行计数 Fix https://github.com/siyuan-note/siyuan/issues/7398

This commit is contained in:
Liang Ding 2023-02-18 14:37:54 +08:00
parent dc63e56641
commit 7b41e698e1
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
3 changed files with 23 additions and 9 deletions

View file

@ -110,6 +110,12 @@ func FlushQueue() {
defer enableCache()
}
groupOpsTotal := map[string]int{}
for _, op := range ops {
groupOpsTotal[op.action]++
}
groupOpsCurrent := map[string]int{}
for i, op := range ops {
if util.IsExiting {
return
@ -120,8 +126,9 @@ func FlushQueue() {
return
}
context["current"] = i
context["total"] = total
groupOpsCurrent[op.action]++
context["current"] = groupOpsCurrent[op.action]
context["total"] = groupOpsTotal[op.action]
if err = execOp(op, tx, context); nil != err {
tx.Rollback()
logging.LogErrorf("queue operation failed: %s", err)