mirror of https://github.com/Xhofe/alist
fix: increase timeout for http_client (close #4409)
parent
a3446720a2
commit
63de65be45
|
@ -40,7 +40,7 @@ func NewRestyClient() *resty.Client {
|
||||||
|
|
||||||
func NewHttpClient() *http.Client {
|
func NewHttpClient() *http.Client {
|
||||||
return &http.Client{
|
return &http.Client{
|
||||||
Timeout: DefaultTimeout,
|
Timeout: time.Hour * 48,
|
||||||
Transport: &http.Transport{
|
Transport: &http.Transport{
|
||||||
TLSClientConfig: &tls.Config{InsecureSkipVerify: conf.Conf.TlsInsecureSkipVerify},
|
TLSClientConfig: &tls.Config{InsecureSkipVerify: conf.Conf.TlsInsecureSkipVerify},
|
||||||
},
|
},
|
||||||
|
|
|
@ -8,11 +8,11 @@ import (
|
||||||
stdpath "path"
|
stdpath "path"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/alist-org/alist/v3/drivers/base"
|
|
||||||
"github.com/alist-org/alist/v3/internal/conf"
|
"github.com/alist-org/alist/v3/internal/conf"
|
||||||
"github.com/alist-org/alist/v3/internal/model"
|
"github.com/alist-org/alist/v3/internal/model"
|
||||||
"github.com/alist-org/alist/v3/internal/op"
|
"github.com/alist-org/alist/v3/internal/op"
|
||||||
"github.com/alist-org/alist/v3/pkg/utils"
|
"github.com/alist-org/alist/v3/pkg/utils"
|
||||||
|
"github.com/alist-org/alist/v3/server/common"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
)
|
)
|
||||||
|
@ -59,7 +59,7 @@ func getFileStreamFromLink(file model.Obj, link *model.Link) (*model.FileStream,
|
||||||
for h, val := range link.Header {
|
for h, val := range link.Header {
|
||||||
req.Header[h] = val
|
req.Header[h] = val
|
||||||
}
|
}
|
||||||
res, err := base.HttpClient.Do(req)
|
res, err := common.HttpClient().Do(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrapf(err, "failed to get response for %s", link.URL)
|
return nil, errors.Wrapf(err, "failed to get response for %s", link.URL)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue