mirror of
https://github.com/astaxie/beego.git
synced 2024-11-26 16:51:28 +00:00
set default timeout
This commit is contained in:
parent
d8fa118727
commit
f56bdb6284
@ -357,6 +357,13 @@ func (b *BeegoHttpRequest) getResponse() (*http.Response, error) {
|
|||||||
|
|
||||||
trans := b.setting.Transport
|
trans := b.setting.Transport
|
||||||
|
|
||||||
|
if b.setting.ConnectTimeout == 0 {
|
||||||
|
b.setting.ConnectTimeout = 30 * time.Second
|
||||||
|
}
|
||||||
|
if b.setting.ReadWriteTimeout == 0 {
|
||||||
|
b.setting.ReadWriteTimeout = 30 * time.Second
|
||||||
|
}
|
||||||
|
|
||||||
if trans == nil {
|
if trans == nil {
|
||||||
// create default transport
|
// create default transport
|
||||||
trans = &http.Transport{
|
trans = &http.Transport{
|
||||||
|
Loading…
Reference in New Issue
Block a user