mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 Reduce the probability of tree not found when deleting/renaming tags https://github.com/siyuan-note/siyuan/issues/14591
This commit is contained in:
parent
b66558059d
commit
6c60a3726f
2 changed files with 6 additions and 7 deletions
|
|
@ -178,8 +178,6 @@ var (
|
|||
)
|
||||
|
||||
func LoadTreeByBlockIDWithReindex(id string) (ret *parse.Tree, err error) {
|
||||
// 仅提供给 getBlockInfo 接口使用
|
||||
|
||||
if "" == id {
|
||||
logging.LogWarnf("block id is empty")
|
||||
return nil, ErrTreeNotFound
|
||||
|
|
@ -192,8 +190,9 @@ func LoadTreeByBlockIDWithReindex(id string) (ret *parse.Tree, err error) {
|
|||
return
|
||||
}
|
||||
|
||||
// 尝试从文件系统加载
|
||||
searchTreeInFilesystem(id)
|
||||
// 尝试从文件系统加载并建立索引
|
||||
indexTreeInFilesystem(id)
|
||||
|
||||
bt = treenode.GetBlockTree(id)
|
||||
if nil == bt {
|
||||
if "dev" == util.Mode {
|
||||
|
|
@ -243,7 +242,7 @@ func loadTreeByBlockTree(bt *treenode.BlockTree) (ret *parse.Tree, err error) {
|
|||
|
||||
var searchTreeLimiter = rate.NewLimiter(rate.Every(3*time.Second), 1)
|
||||
|
||||
func searchTreeInFilesystem(rootID string) {
|
||||
func indexTreeInFilesystem(rootID string) {
|
||||
if !searchTreeLimiter.Allow() {
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue