mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-19 06:43:42 +00:00
fix: retry
This commit is contained in:
1 parent
046729bfaa
commit
caf9bf265b
2 files changed
+2
-11
No files matched your search
@@ -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
|
|
||||||
}
|
|
||||||
@@ -295,6 +295,8 @@ func (f *Fetcher) fetchChunk(index int) (err error) {
|
|||||||
// 请求失败重试
|
// 请求失败重试
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
// 请求成功就重置错误次数,连续失败5次才终止
|
||||||
|
i = 0
|
||||||
retry, err = func() (bool, error) {
|
retry, err = func() (bool, error) {
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
for {
|
for {
|
||||||
|
|||||||
Reference in new issue
Block a user