mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
🎨 改进内核任务调度机制提升稳定性 https://github.com/siyuan-note/siyuan/issues/7113
This commit is contained in:
parent
981e598149
commit
b5fc879628
4 changed files with 32 additions and 4 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue