Commit 9266ece7 authored by astaxie's avatar astaxie

fix the retried

parent 61e694f3
...@@ -480,7 +480,7 @@ func (b *BeegoHTTPRequest) DoRequest() (resp *http.Response, err error) { ...@@ -480,7 +480,7 @@ func (b *BeegoHTTPRequest) DoRequest() (resp *http.Response, err error) {
// retries default value is 0, it will run once. // retries default value is 0, it will run once.
// retries equal to -1, it will run forever until success // retries equal to -1, it will run forever until success
// retries is setted, it will retries fixed times. // 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) resp, err = client.Do(b.req)
if err == nil { if err == nil {
break break
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment