优化代码

This commit is contained in:
刘祥超
2023-06-07 19:30:51 +08:00
parent fc4b45fec7
commit a9389d53e1
2 changed files with 4 additions and 3 deletions

View File

@@ -9,7 +9,7 @@ import (
"net/http"
)
func (this *HTTPRequest) doOSSOrigin(origin *serverconfigs.OriginConfig) (*http.Response, error) {
func (this *HTTPRequest) doOSSOrigin(origin *serverconfigs.OriginConfig) (resp *http.Response, goNext bool, err error) {
// stub
return nil, errors.New("not implemented")
}

View File

@@ -271,8 +271,9 @@ func (this *HTTPRequest) doOriginRequest(failedOriginIds []int64, failedLnNodeId
// 开始请求
resp, requestErr = client.Do(this.RawReq)
} else if origin.OSS != nil { // OSS源站
resp, requestErr = this.doOSSOrigin(origin)
if requestErr == nil && resp == nil {
var goNext bool
resp, goNext, requestErr = this.doOSSOrigin(origin)
if (requestErr == nil && resp == nil) || !goNext {
return
}
} else {