mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-08 00:04:21 +01:00
🐛 集市包下载进度没有展现 Fix https://github.com/siyuan-note/siyuan/issues/6862
This commit is contained in:
parent
d369d52499
commit
ebca8b7414
3 changed files with 25 additions and 28 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue