Skip to content

Commit

Permalink
域名自动切换逻辑: 开放域名自动切换方法 ChangeURI
Browse files Browse the repository at this point in the history
  • Loading branch information
SpringDRen committed Feb 26, 2021
1 parent c98cbe1 commit cc3295d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sdk/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (rc *RongCloud) httpRequest(b *httplib.BeegoHTTPRequest) (body []byte, err
resp, err := b.DoRequest()
if err != nil {
if isNetError(err) {
rc.changeURI()
rc.ChangeURI()
}
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions sdk/rongcloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func (rc *RongCloud) urlError(err error) {
// if reflect.TypeOf(err) == reflect.TypeOf(&url.Error{}) {
// if err.(*url.Error).Timeout() {
// if rc.count >= rc.numTimeout {
// rc.changeURI()
// rc.ChangeURI()
// rc.count = 1
// } else {
// rc.count++
Expand All @@ -204,7 +204,7 @@ func (rc *RongCloud) urlError(err error) {
*/
func (rc *RongCloud) checkStatusCode(resp *http.Response) {
if resp.StatusCode >= 500 && resp.StatusCode < 600 {
rc.changeURI()
rc.ChangeURI()
}

return
Expand Down

0 comments on commit cc3295d

Please sign in to comment.