🎨 改进内核任务调度机制提升稳定性 https://github.com/siyuan-note/siyuan/issues/7113

This commit is contained in:
Liang Ding 2023-01-25 10:58:04 +08:00
parent c5f4d3c780
commit 6495574fea
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
8 changed files with 60 additions and 55 deletions

View file

@ -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
}