mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 15:10:12 +01:00
🎨 改进状态栏显示后台任务执行计数 Fix https://github.com/siyuan-note/siyuan/issues/7398
This commit is contained in:
parent
dc63e56641
commit
7b41e698e1
3 changed files with 23 additions and 9 deletions
|
|
@ -268,7 +268,7 @@ func init() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
current := context["current"].(int) + 1
|
current := context["current"].(int)
|
||||||
total := context["total"]
|
total := context["total"]
|
||||||
msg := fmt.Sprintf(Conf.Language(90), current, total, blockCount, hash)
|
msg := fmt.Sprintf(Conf.Language(90), current, total, blockCount, hash)
|
||||||
util.SetBootDetails(msg)
|
util.SetBootDetails(msg)
|
||||||
|
|
@ -280,7 +280,7 @@ func init() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
current := context["current"].(int) + 1
|
current := context["current"].(int)
|
||||||
total := context["total"]
|
total := context["total"]
|
||||||
msg := fmt.Sprintf(Conf.Language(93), current, total, rootID)
|
msg := fmt.Sprintf(Conf.Language(93), current, total, rootID)
|
||||||
util.SetBootDetails(msg)
|
util.SetBootDetails(msg)
|
||||||
|
|
@ -292,7 +292,7 @@ func init() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
current := context["current"].(int) + 1
|
current := context["current"].(int)
|
||||||
total := context["total"]
|
total := context["total"]
|
||||||
msg := fmt.Sprintf(Conf.Language(191), current, total)
|
msg := fmt.Sprintf(Conf.Language(191), current, total)
|
||||||
util.SetBootDetails(msg)
|
util.SetBootDetails(msg)
|
||||||
|
|
|
||||||
|
|
@ -110,6 +110,12 @@ func FlushQueue() {
|
||||||
defer enableCache()
|
defer enableCache()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
groupOpsTotal := map[string]int{}
|
||||||
|
for _, op := range ops {
|
||||||
|
groupOpsTotal[op.action]++
|
||||||
|
}
|
||||||
|
|
||||||
|
groupOpsCurrent := map[string]int{}
|
||||||
for i, op := range ops {
|
for i, op := range ops {
|
||||||
if util.IsExiting {
|
if util.IsExiting {
|
||||||
return
|
return
|
||||||
|
|
@ -120,8 +126,9 @@ func FlushQueue() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
context["current"] = i
|
groupOpsCurrent[op.action]++
|
||||||
context["total"] = total
|
context["current"] = groupOpsCurrent[op.action]
|
||||||
|
context["total"] = groupOpsTotal[op.action]
|
||||||
if err = execOp(op, tx, context); nil != err {
|
if err = execOp(op, tx, context); nil != err {
|
||||||
tx.Rollback()
|
tx.Rollback()
|
||||||
logging.LogErrorf("queue operation failed: %s", err)
|
logging.LogErrorf("queue operation failed: %s", err)
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,13 @@ func FlushHistoryQueue() {
|
||||||
defer txLock.Unlock()
|
defer txLock.Unlock()
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
|
|
||||||
total := len(ops)
|
groupOpsTotal := map[string]int{}
|
||||||
|
for _, op := range ops {
|
||||||
|
groupOpsTotal[op.action]++
|
||||||
|
}
|
||||||
|
|
||||||
|
context := map[string]interface{}{eventbus.CtxPushMsg: eventbus.CtxPushMsgToStatusBar}
|
||||||
|
groupOpsCurrent := map[string]int{}
|
||||||
for i, op := range ops {
|
for i, op := range ops {
|
||||||
if util.IsExiting {
|
if util.IsExiting {
|
||||||
return
|
return
|
||||||
|
|
@ -70,9 +76,10 @@ func FlushHistoryQueue() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
context := map[string]interface{}{eventbus.CtxPushMsg: eventbus.CtxPushMsgToStatusBar}
|
groupOpsCurrent[op.action]++
|
||||||
context["current"] = i
|
context["current"] = groupOpsCurrent[op.action]
|
||||||
context["total"] = total
|
context["total"] = groupOpsTotal[op.action]
|
||||||
|
|
||||||
if err = execHistoryOp(op, tx, context); nil != err {
|
if err = execHistoryOp(op, tx, context); nil != err {
|
||||||
tx.Rollback()
|
tx.Rollback()
|
||||||
logging.LogErrorf("queue operation failed: %s", err)
|
logging.LogErrorf("queue operation failed: %s", err)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue