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
c5f4d3c780
commit
6495574fea
8 changed files with 60 additions and 55 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue