mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 改进内核任务调度机制提升稳定性 https://github.com/siyuan-note/siyuan/issues/7113
This commit is contained in:
parent
c1ff45f4a4
commit
7d1b50116b
14 changed files with 51 additions and 52 deletions
|
|
@ -114,7 +114,9 @@ func FlushQueue() {
|
|||
return
|
||||
}
|
||||
|
||||
if err = execOp(op, tx, i, total, context); nil != err {
|
||||
context["current"] = i
|
||||
context["total"] = total
|
||||
if err = execOp(op, tx, context); nil != err {
|
||||
logging.LogErrorf("queue operation failed: %s", err)
|
||||
return
|
||||
}
|
||||
|
|
@ -131,12 +133,12 @@ func FlushQueue() {
|
|||
}
|
||||
}
|
||||
|
||||
func execOp(op *dbQueueOperation, tx *sql.Tx, current, total int, context map[string]interface{}) (err error) {
|
||||
func execOp(op *dbQueueOperation, tx *sql.Tx, context map[string]interface{}) (err error) {
|
||||
switch op.action {
|
||||
case "index":
|
||||
err = indexTree(tx, op.box, op.indexPath, current, total, context)
|
||||
err = indexTree(tx, op.box, op.indexPath, context)
|
||||
case "upsert":
|
||||
err = upsertTree(tx, op.upsertTree, current, total, context)
|
||||
err = upsertTree(tx, op.upsertTree, context)
|
||||
case "delete":
|
||||
err = batchDeleteByPathPrefix(tx, op.removeTreeBox, op.removeTreePath)
|
||||
case "delete_id":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue