mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-19 16:10:12 +01:00
🎨 改进内核任务调度机制提升稳定性 https://github.com/siyuan-note/siyuan/issues/7113
This commit is contained in:
parent
6b356ba226
commit
07ad00ec95
2 changed files with 8 additions and 4 deletions
|
|
@ -391,12 +391,14 @@ func getBlock(id string) (ret *Block, err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
waitForIndexing()
|
|
||||||
|
|
||||||
tree, err := loadTreeByBlockID(id)
|
tree, err := loadTreeByBlockID(id)
|
||||||
|
if nil != err {
|
||||||
|
waitForIndexing()
|
||||||
|
tree, err = loadTreeByBlockID(id)
|
||||||
if nil != err {
|
if nil != err {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
node := treenode.GetNodeInTree(tree, id)
|
node := treenode.GetNodeInTree(tree, id)
|
||||||
sqlBlock := sql.BuildBlockFromNode(node, tree)
|
sqlBlock := sql.BuildBlockFromNode(node, tree)
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"path"
|
"path"
|
||||||
|
"runtime/debug"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
|
@ -121,7 +122,7 @@ func FlushQueue() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if 0 < i && 0 == execOps%64 {
|
if 0 < i && 0 == execOps%128 {
|
||||||
if err = commitTx(tx); nil != err {
|
if err = commitTx(tx); nil != err {
|
||||||
logging.LogErrorf("commit tx failed: %s", err)
|
logging.LogErrorf("commit tx failed: %s", err)
|
||||||
return
|
return
|
||||||
|
|
@ -132,6 +133,7 @@ func FlushQueue() {
|
||||||
if nil != err {
|
if nil != err {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
debug.FreeOSMemory()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue