mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-26 08:54:07 +01:00
⚡ Improve database table view update time column rendering performance https://github.com/siyuan-note/siyuan/issues/9719
This commit is contained in:
parent
72752f441a
commit
5c182e2ea7
2 changed files with 30 additions and 5 deletions
|
|
@ -268,3 +268,28 @@ func GetBlockAttrs(id string) (ret map[string]string) {
|
|||
cache.PutBlockIAL(id, ret)
|
||||
return
|
||||
}
|
||||
|
||||
func GetBlockAttrsWithoutWaitWriting(id string) (ret map[string]string) {
|
||||
ret = map[string]string{}
|
||||
if cached := cache.GetBlockIAL(id); nil != cached {
|
||||
ret = cached
|
||||
return
|
||||
}
|
||||
|
||||
tree, err := loadTreeByBlockID(id)
|
||||
if nil != err {
|
||||
return
|
||||
}
|
||||
|
||||
node := treenode.GetNodeInTree(tree, id)
|
||||
if nil == node {
|
||||
logging.LogWarnf("block [%s] not found", id)
|
||||
return
|
||||
}
|
||||
|
||||
for _, kv := range node.KramdownIAL {
|
||||
ret[kv[0]] = html.UnescapeAttrVal(kv[1])
|
||||
}
|
||||
cache.PutBlockIAL(id, ret)
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue