From d32dedf00c39ee1e128e064233b4d4c274e75a3d Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Mon, 23 Jan 2023 18:53:08 +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/index.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kernel/model/index.go b/kernel/model/index.go index 3184461ae..f5b7ab140 100644 --- a/kernel/model/index.go +++ b/kernel/model/index.go @@ -70,6 +70,8 @@ func index(boxID string) { i := 0 util.PushEndlessProgress(fmt.Sprintf("["+box.Name+"] "+Conf.Language(64), len(files))) + defer util.PushClearProgress() + for _, file := range files { if file.isdir || !strings.HasSuffix(file.name, ".sy") { continue @@ -127,6 +129,7 @@ func IndexRefs() { refTreeIDs.Add(refBlock.RootID) } + i := 0 if 0 < refTreeIDs.Size() { luteEngine := NewLute() bootProgressPart := 10.0 / float64(refTreeIDs.Size()) @@ -134,7 +137,6 @@ func IndexRefs() { sql.DeleteBoxRefsQueue(box.ID) files := box.ListFiles("/") - i := 0 for _, file := range files { if file.isdir || !strings.HasSuffix(file.name, ".sy") { continue @@ -166,6 +168,7 @@ func IndexRefs() { } } logging.LogInfof("resolved refs [%d] in [%dms]", len(refBlocks), time.Now().Sub(start).Milliseconds()) + util.PushStatusBar(fmt.Sprintf(Conf.Language(55), i)) } func init() {