From d7419e80296e7b46baf7d3698dae8e4248c17a1e Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Wed, 25 Jan 2023 22:58:25 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E6=94=B9=E8=BF=9B=E5=86=85=E6=A0=B8?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E8=B0=83=E5=BA=A6=E6=9C=BA=E5=88=B6=E6=8F=90?= =?UTF-8?q?=E5=8D=87=E7=A8=B3=E5=AE=9A=E6=80=A7=20https://github.com/siyua?= =?UTF-8?q?n-note/siyuan/issues/7113?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/model/block.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/kernel/model/block.go b/kernel/model/block.go index 2ad01bf80..1cc22caba 100644 --- a/kernel/model/block.go +++ b/kernel/model/block.go @@ -19,12 +19,13 @@ package model import ( "errors" "fmt" - "github.com/siyuan-note/siyuan/kernel/task" + "time" "github.com/88250/lute" "github.com/88250/lute/ast" "github.com/88250/lute/parse" "github.com/siyuan-note/siyuan/kernel/sql" + "github.com/siyuan-note/siyuan/kernel/task" "github.com/siyuan-note/siyuan/kernel/treenode" "github.com/siyuan-note/siyuan/kernel/util" ) @@ -396,8 +397,14 @@ func getBlock(id string) (ret *Block, err error) { if nil != err { if task.ContainIndexTask() { err = ErrIndexing + return + } + + time.Sleep(1 * time.Second) + tree, err = loadTreeByBlockID(id) + if nil != err { + return } - return } node := treenode.GetNodeInTree(tree, id)