d8734cf5 by JessonChan Committed by astaxie

set default timeout

1 parent 51161361
...@@ -357,6 +357,13 @@ func (b *BeegoHttpRequest) getResponse() (*http.Response, error) { ...@@ -357,6 +357,13 @@ func (b *BeegoHttpRequest) getResponse() (*http.Response, error) {
357 357
358 trans := b.setting.Transport 358 trans := b.setting.Transport
359 359
360 if b.setting.ConnectTimeout == 0 {
361 b.setting.ConnectTimeout = 30 * time.Second
362 }
363 if b.setting.ReadWriteTimeout == 0 {
364 b.setting.ReadWriteTimeout = 30 * time.Second
365 }
366
360 if trans == nil { 367 if trans == nil {
361 // create default transport 368 // create default transport
362 trans = &http.Transport{ 369 trans = &http.Transport{
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!