mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-04-30 23:30:22 -05:00
🎨 改进内核任务调度机制提升稳定性 https://github.com/siyuan-note/siyuan/issues/7113
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user