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

This commit is contained in:
Liang Ding 2023-01-25 20:32:25 +08:00
parent 6b356ba226
commit 07ad00ec95
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
2 changed files with 8 additions and 4 deletions

View file

@ -391,11 +391,13 @@ func getBlock(id string) (ret *Block, err error) {
return
}
waitForIndexing()
tree, err := loadTreeByBlockID(id)
if nil != err {
return
waitForIndexing()
tree, err = loadTreeByBlockID(id)
if nil != err {
return
}
}
node := treenode.GetNodeInTree(tree, id)

View file

@ -21,6 +21,7 @@ import (
"errors"
"fmt"
"path"
"runtime/debug"
"sync"
"time"
@ -121,7 +122,7 @@ func FlushQueue() {
return
}
if 0 < i && 0 == execOps%64 {
if 0 < i && 0 == execOps%128 {
if err = commitTx(tx); nil != err {
logging.LogErrorf("commit tx failed: %s", err)
return
@ -132,6 +133,7 @@ func FlushQueue() {
if nil != err {
return
}
debug.FreeOSMemory()
}
}