🎨 改进内核任务调度机制提升稳定性 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

@ -46,27 +46,28 @@ type Block struct {
Updated string
}
func updateRootContent(tx *sql.Tx, content, updated, id string) {
func updateRootContent(tx *sql.Tx, content, updated, id string) (err error) {
stmt := "UPDATE blocks SET content = ?, fcontent = ?, updated = ? WHERE id = ?"
if err := execStmtTx(tx, stmt, content, content, updated, id); nil != err {
if err = execStmtTx(tx, stmt, content, content, updated, id); nil != err {
return
}
stmt = "UPDATE blocks_fts SET content = ?, fcontent = ?, updated = ? WHERE id = ?"
if err := execStmtTx(tx, stmt, content, content, updated, id); nil != err {
if err = execStmtTx(tx, stmt, content, content, updated, id); nil != err {
return
}
if !caseSensitive {
stmt = "UPDATE blocks_fts_case_insensitive SET content = ?, fcontent = ?, updated = ? WHERE id = ?"
if err := execStmtTx(tx, stmt, content, content, updated, id); nil != err {
if err = execStmtTx(tx, stmt, content, content, updated, id); nil != err {
return
}
}
removeBlockCache(id)
cache.RemoveBlockIAL(id)
return
}
func UpdateBlockContent(block *Block) {
tx, err := BeginTx()
tx, err := beginTx()
if nil != err {
return
}
@ -93,7 +94,7 @@ func UpdateBlockContent(block *Block) {
}
func DeleteTree(table, rootID string) {
tx, err := BeginTx()
tx, err := beginTx()
if nil != err {
return
}