From 9266ece7a408aa00c918db7789a6713b11695065 Mon Sep 17 00:00:00 2001 From: astaxie Date: Thu, 5 Jan 2017 18:27:23 +0800 Subject: [PATCH] fix the retried --- httplib/httplib.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httplib/httplib.go b/httplib/httplib.go index 87513c94..39480469 100644 --- a/httplib/httplib.go +++ b/httplib/httplib.go @@ -480,7 +480,7 @@ func (b *BeegoHTTPRequest) DoRequest() (resp *http.Response, err error) { // retries default value is 0, it will run once. // retries equal to -1, it will run forever until success // retries is setted, it will retries fixed times. - for i := 0; i == 0 || b.setting.Retries == -1 || i < b.setting.Retries; i++ { + for i := 0; b.setting.Retries == -1 || i <= b.setting.Retries; i++ { resp, err = client.Do(b.req) if err == nil { break