mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-26 11:28:49 +01:00
🎨 改进内核任务调度机制提升稳定性 https://github.com/siyuan-note/siyuan/issues/7113
This commit is contained in:
parent
c5f4d3c780
commit
6495574fea
8 changed files with 60 additions and 55 deletions
|
|
@ -524,11 +524,10 @@ func clearOutdatedHistoryDir(historyDir string) {
|
|||
p := strings.TrimPrefix(dir, util.HistoryDir)
|
||||
p = filepath.ToSlash(p[1:])
|
||||
if txErr = sql.DeleteHistoriesByPathPrefix(tx, dir); nil != txErr {
|
||||
sql.RollbackTx(tx)
|
||||
logging.LogErrorf("delete history [%s] failed: %s", dir, txErr)
|
||||
return
|
||||
}
|
||||
if txErr = sql.CommitTx(tx); nil != txErr {
|
||||
if txErr = sql.CommitHistoryTx(tx); nil != txErr {
|
||||
logging.LogErrorf("commit history tx failed: %s", txErr)
|
||||
return
|
||||
}
|
||||
|
|
@ -683,10 +682,9 @@ func indexHistoryDir(name string, luteEngine *lute.Lute) {
|
|||
}
|
||||
if err := sql.InsertHistories(tx, histories); nil != err {
|
||||
logging.LogErrorf("insert histories failed: %s", err)
|
||||
sql.RollbackTx(tx)
|
||||
return
|
||||
}
|
||||
if err := sql.CommitTx(tx); nil != err {
|
||||
if err := sql.CommitHistoryTx(tx); nil != err {
|
||||
logging.LogErrorf("commit transaction failed: %s", err)
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue