🐛 集市包下载进度没有展现 Fix https://github.com/siyuan-note/siyuan/issues/6862

This commit is contained in:
Liang Ding 2022-12-13 11:03:40 +08:00
parent d369d52499
commit ebca8b7414
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
3 changed files with 25 additions and 28 deletions

View file

@ -305,12 +305,7 @@ func downloadPackage(repoURLHash string, pushProgress bool, systemID string) (da
repoURLHash = strings.TrimPrefix(repoURLHash, "https://github.com/")
u := util.BazaarOSSServer + "/package/" + repoURLHash
buf := &bytes.Buffer{}
resp, err := req.C().
SetUserAgent(util.UserAgent).
SetTimeout(30 * time.Second).
DisableInsecureSkipVerify().
R().SetRetryCount(1).
SetOutput(buf).SetDownloadCallback(func(info req.DownloadInfo) {
resp, err := httpclient.NewBrowserRequest().SetOutput(buf).SetDownloadCallback(func(info req.DownloadInfo) {
if pushProgress {
progress := float32(info.DownloadedSize) / float32(info.Response.ContentLength)
logging.LogDebugf("downloading bazaar package [%d]", progress)