mirror of
https://github.com/astaxie/beego.git
synced 2024-11-23 00:50:54 +00:00
set default timeout
This commit is contained in:
parent
f56bdb6284
commit
6c3e274b6e
@ -358,10 +358,10 @@ func (b *BeegoHttpRequest) getResponse() (*http.Response, error) {
|
|||||||
trans := b.setting.Transport
|
trans := b.setting.Transport
|
||||||
|
|
||||||
if b.setting.ConnectTimeout == 0 {
|
if b.setting.ConnectTimeout == 0 {
|
||||||
b.setting.ConnectTimeout = 30 * time.Second
|
b.setting.ConnectTimeout = 60 * time.Second
|
||||||
}
|
}
|
||||||
if b.setting.ReadWriteTimeout == 0 {
|
if b.setting.ReadWriteTimeout == 0 {
|
||||||
b.setting.ReadWriteTimeout = 30 * time.Second
|
b.setting.ReadWriteTimeout = 60 * time.Second
|
||||||
}
|
}
|
||||||
|
|
||||||
if trans == nil {
|
if trans == nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user