fix: retry

This commit is contained in:
liwei committed 2021-03-24 14:03:23 +08:00
1 parent 046729bfaa
commit caf9bf265b
2 files changed
+2 -11

No files matched your search

-11
View File
@@ -1,11 +0,0 @@
package http
import "github.com/monkeyWie/gopeed-core/download/base"
type Event struct {
status base.Status
}
func (e *Event) Status() base.Status {
return e.status
}
+2
View File
@@ -295,6 +295,8 @@ func (f *Fetcher) fetchChunk(index int) (err error) {
// 请求失败重试
continue
}
// 请求成功就重置错误次数,连续失败5次才终止
i = 0
retry, err = func() (bool, error) {
defer resp.Body.Close()
for {