From 4f2c218b356727c35669c66cbafa03532cd246d5 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Wed, 7 Sep 2022 22:54:55 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E6=A1=8C=E9=9D=A2=E7=AB=AF=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E4=B8=8B=E8=BD=BD=E6=9B=B4=E6=96=B0=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E5=8C=85=20https://github.com/siyuan-note/siyuan/issues/5837?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/model/updater.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/model/updater.go b/kernel/model/updater.go index 249824f7f..683a22c87 100644 --- a/kernel/model/updater.go +++ b/kernel/model/updater.go @@ -95,7 +95,7 @@ func downloadInstallPkg(pkgURL, checksum, savePath string) { client := req.C() callback := func(info req.DownloadInfo) { - logging.LogInfof("downloading install package from [%s] %.2f%%", pkgURL, float64(info.DownloadedSize)/float64(info.Response.ContentLength)*100.0) + logging.LogDebugf("downloading install package from [%s] %.2f%%", pkgURL, float64(info.DownloadedSize)/float64(info.Response.ContentLength)*100.0) } resp, err := client.R().SetOutputFile(savePath).SetDownloadCallback(callback).Get(pkgURL) if nil != err { @@ -106,11 +106,12 @@ func downloadInstallPkg(pkgURL, checksum, savePath string) { logging.LogErrorf("download install package [%s] failed [sc=%d]", pkgURL, resp.StatusCode) return } - logging.LogInfof("downloaded install package [%s] to [%s]", pkgURL, savePath) localChecksum, _ := sha256Hash(savePath) if checksum != localChecksum { logging.LogErrorf("verify checksum failed, download install package [%s] checksum [%s] not equal to downloaded [%s] checksum [%s]", pkgURL, checksum, savePath, localChecksum) + return } + logging.LogInfof("downloaded install package [%s] to [%s]", pkgURL, savePath) } func sha256Hash(filename string) (ret string, err error) {