Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

你好,这里有个疑惑,能否帮忙确认我的理解是否有误,此处return语句是否应该返回true,用于下一轮重试。 #24

Closed
pixeldin opened this issue Jun 14, 2021 · 2 comments

Comments

@pixeldin
Copy link

https://github.com/monkeyWie/gopeed-core/blob/bbd553d9101594836be1270a9d48bc4d454cdc8a/internal/protocol/http/fetcher.go#L305


作者你好,我这里猜测这个重试逻辑是这样的
重试区间:
根据当前chunk设置文件区间到header用于发起请求

  • 判断请求返回status code
    • 失败: 少于5次做重试
    • 成功:
      根据offset, 把buf写入文件
      • 写入成功: return, 通知外部
      • 写入失败: 重试少于5次, 返回重试

还是说,作者有意放弃对文件WriteAt()接口的err重试,直接跳出呢,等待解答 ~ :)

@monkeyWie
Copy link
Member

是的,文件写入失败的话就不进行重试了,重试只是在网络层进行

@pixeldin
Copy link
Author

好的, 了解啦。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants