From 8399f852a465fb58475779aac6a7805d6abbe7a5 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Wed, 7 Sep 2022 23:00:15 +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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kernel/model/updater.go b/kernel/model/updater.go index 683a22c87..131d8c71c 100644 --- a/kernel/model/updater.go +++ b/kernel/model/updater.go @@ -25,6 +25,7 @@ import ( "path/filepath" "runtime" "sync" + "time" "github.com/88250/gulu" "github.com/imroc/req/v3" @@ -93,9 +94,10 @@ func downloadInstallPkg(pkgURL, checksum, savePath string) { } } - client := req.C() + logging.LogInfof("downloading install package [%s]", pkgURL) + client := req.C().SetTimeout(60 * time.Minute) callback := func(info req.DownloadInfo) { - logging.LogDebugf("downloading install package from [%s] %.2f%%", pkgURL, float64(info.DownloadedSize)/float64(info.Response.ContentLength)*100.0) + //logging.LogDebugf("downloading install package [%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 {