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

This commit is contained in:
Liang Ding 2023-01-25 12:33:38 +08:00
parent 981e598149
commit b5fc879628
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
4 changed files with 32 additions and 4 deletions

View file

@ -21,6 +21,7 @@ import (
"crypto/sha256"
"database/sql"
"fmt"
"github.com/siyuan-note/siyuan/kernel/filesys"
"strings"
"github.com/88250/lute/parse"
@ -392,6 +393,16 @@ func insertRefs(tx *sql.Tx, tree *parse.Tree) (err error) {
return err
}
func indexTree(tx *sql.Tx, box, p string, context map[string]interface{}) (err error) {
tree, err := filesys.LoadTree(box, p, luteEngine)
if nil != err {
return
}
err = upsertTree(tx, tree, context)
return
}
func upsertTree(tx *sql.Tx, tree *parse.Tree, context map[string]interface{}) (err error) {
oldBlockHashes := queryBlockHashes(tree.ID)
blocks, spans, assets, attributes := fromTree(tree.Root, tree)