fix(report): set http timeout 10 sec (#1154)

* fix(report): set http timeout 10 sec

* fix: add an error handling
This commit is contained in:
Kota Kanbe
2021-01-30 09:40:33 +09:00
committed by GitHub
parent 39b19444fe
commit 4dcbd865cc
17 changed files with 105 additions and 72 deletions

View File

@@ -154,7 +154,7 @@ func httpGet(url string, req request, resChan chan<- response, errChan chan<- er
count, retryMax := 0, 3
f := func() (err error) {
// resp, body, errs = gorequest.New().SetDebug(config.Conf.Debug).Get(url).End()
resp, body, errs = gorequest.New().Get(url).End()
resp, body, errs = gorequest.New().Timeout(10 * time.Second).Get(url).End()
if 0 < len(errs) || resp == nil || resp.StatusCode != 200 {
count++
if count == retryMax {