mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-29 11:40:24 +08:00
优化代码
This commit is contained in:
@@ -9,7 +9,7 @@ import (
|
|||||||
"net/http"
|
"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
|
// stub
|
||||||
return nil, errors.New("not implemented")
|
return nil, errors.New("not implemented")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -271,8 +271,9 @@ func (this *HTTPRequest) doOriginRequest(failedOriginIds []int64, failedLnNodeId
|
|||||||
// 开始请求
|
// 开始请求
|
||||||
resp, requestErr = client.Do(this.RawReq)
|
resp, requestErr = client.Do(this.RawReq)
|
||||||
} else if origin.OSS != nil { // OSS源站
|
} else if origin.OSS != nil { // OSS源站
|
||||||
resp, requestErr = this.doOSSOrigin(origin)
|
var goNext bool
|
||||||
if requestErr == nil && resp == nil {
|
resp, goNext, requestErr = this.doOSSOrigin(origin)
|
||||||
|
if (requestErr == nil && resp == nil) || !goNext {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user