mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-08 00:04:21 +01:00
⚡ Improve data indexing to reduce disk read operations https://github.com/siyuan-note/siyuan/issues/16958
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
dc00060062
commit
87282404bb
4 changed files with 65 additions and 45 deletions
|
|
@ -649,16 +649,7 @@ func buildSpanFromNode(n *ast.Node, tree *parse.Tree, rootID, boxID, p string) (
|
|||
title = gulu.Str.FromBytes(titleNode.Tokens)
|
||||
}
|
||||
|
||||
var hash string
|
||||
var hashErr error
|
||||
if lp := assetLocalPath(dest, boxLocalPath, docDirLocalPath); "" != lp {
|
||||
if !gulu.File.IsDir(lp) {
|
||||
hash, hashErr = util.GetEtag(lp)
|
||||
if nil != hashErr {
|
||||
logging.LogErrorf("calc asset [%s] hash failed: %s", lp, hashErr)
|
||||
}
|
||||
}
|
||||
}
|
||||
hash := assetHashByLocalPath(dest, boxLocalPath, docDirLocalPath)
|
||||
name, _ := util.LastID(dest)
|
||||
asset := &Asset{
|
||||
ID: ast.NewNodeID(),
|
||||
|
|
@ -700,16 +691,7 @@ func buildSpanFromNode(n *ast.Node, tree *parse.Tree, rootID, boxID, p string) (
|
|||
title = gulu.Str.FromBytes(titleNode.Tokens)
|
||||
}
|
||||
|
||||
var hash string
|
||||
var hashErr error
|
||||
if lp := assetLocalPath(dest, boxLocalPath, docDirLocalPath); "" != lp {
|
||||
if !gulu.File.IsDir(lp) {
|
||||
hash, hashErr = util.GetEtag(lp)
|
||||
if nil != hashErr {
|
||||
logging.LogErrorf("calc asset [%s] hash failed: %s", lp, hashErr)
|
||||
}
|
||||
}
|
||||
}
|
||||
hash := assetHashByLocalPath(dest, boxLocalPath, docDirLocalPath)
|
||||
name, _ := util.LastID(dest)
|
||||
asset := &Asset{
|
||||
ID: ast.NewNodeID(),
|
||||
|
|
@ -790,15 +772,7 @@ func buildSpanFromNode(n *ast.Node, tree *parse.Tree, rootID, boxID, p string) (
|
|||
}
|
||||
|
||||
dest := string(src)
|
||||
var hash string
|
||||
var hashErr error
|
||||
if lp := assetLocalPath(dest, boxLocalPath, docDirLocalPath); "" != lp {
|
||||
hash, hashErr = util.GetEtag(lp)
|
||||
if nil != hashErr {
|
||||
logging.LogErrorf("calc asset [%s] hash failed: %s", lp, hashErr)
|
||||
}
|
||||
}
|
||||
|
||||
hash := assetHashByLocalPath(dest, boxLocalPath, docDirLocalPath)
|
||||
parentBlock := treenode.ParentBlock(n)
|
||||
if ast.NodeInlineHTML != n.Type {
|
||||
parentBlock = n
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue