Merged
Conversation
Contributor
There was a problem hiding this comment.
是不是简单认为 code/100 == 5 && code != 579 就可以了?
Contributor
Author
There was a problem hiding this comment.
这里我还是列举出了不重试的情况。。考虑到比如连不上upload.qiniu.com,这样就收不到服务端的状态码
Contributor
There was a problem hiding this comment.
连不上当然是要重试的。我的意思不能重试的code应该是不可枚举的吧?
Contributor
Author
There was a problem hiding this comment.
不重试:参数问题,我们的服务器问题,这些都可以根据code过滤掉;
但是重试的话,因为不清楚客户端和代理之间会发生什么事情(连不上,端口被拒绝,被reset掉等),以及代理服务器会发出什么样的错误,我觉得重试才是不可枚举的。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
host的重试逻辑