mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-06 16:58:49 +01:00
🎨 调整网络请求超时为 30s Fix https://github.com/siyuan-note/siyuan/issues/6791
设置代理切换时不再需要重启 https://github.com/siyuan-note/siyuan/issues/6787
This commit is contained in:
parent
9f463fec1e
commit
74453a20bb
8 changed files with 40 additions and 59 deletions
|
|
@ -305,14 +305,14 @@ 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 := httpclient.NewBrowserDownloadRequest().SetOutput(buf).SetDownloadCallback(func(info req.DownloadInfo) {
|
||||
resp, err := httpclient.NewBrowserRequest().SetOutput(buf).SetDownloadCallback(func(info req.DownloadInfo) {
|
||||
if pushProgress {
|
||||
util.PushDownloadProgress(pushID, float32(info.DownloadedSize)/float32(info.Response.ContentLength))
|
||||
}
|
||||
}).Get(u)
|
||||
if nil != err {
|
||||
u = util.BazaarOSSServer + "/package/" + repoURLHash
|
||||
resp, err = httpclient.NewBrowserDownloadRequest().SetOutput(buf).SetDownloadCallback(func(info req.DownloadInfo) {
|
||||
resp, err = httpclient.NewBrowserRequest().SetOutput(buf).SetDownloadCallback(func(info req.DownloadInfo) {
|
||||
if pushProgress {
|
||||
util.PushDownloadProgress(pushID, float32(info.DownloadedSize)/float32(info.Response.ContentLength))
|
||||
}
|
||||
|
|
@ -339,7 +339,7 @@ func incPackageDownloads(repoURLHash, systemID string) {
|
|||
|
||||
repo := strings.Split(repoURLHash, "@")[0]
|
||||
u := util.AliyunServer + "/apis/siyuan/bazaar/addBazaarPackageDownloadCount"
|
||||
httpclient.NewCloudRequest().SetBody(
|
||||
httpclient.NewCloudRequest30s().SetBody(
|
||||
map[string]interface{}{
|
||||
"systemID": systemID,
|
||||
"repo": repo,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue