- AccessPlatformAPIWithRetry的回调handleResponse添加response参数
- 饿百从网页取门店健康信息
This commit is contained in:
@@ -89,7 +89,7 @@ func getClonedData(requestURL *url.URL, r *bytes.Buffer) string {
|
||||
return retVal
|
||||
}
|
||||
|
||||
func AccessPlatformAPIWithRetry(client *http.Client, handleRequest func() *http.Request, config *APIConfig, handleResponse func(bodyMap map[string]interface{}) (string, error)) error {
|
||||
func AccessPlatformAPIWithRetry(client *http.Client, handleRequest func() *http.Request, config *APIConfig, handleResponse func(response *http.Response, bodyMap map[string]interface{}) (string, error)) error {
|
||||
exceedLimitRetryCount := 0
|
||||
recoverableErrorRetryCount := 0
|
||||
for {
|
||||
@@ -155,7 +155,7 @@ func AccessPlatformAPIWithRetry(client *http.Client, handleRequest func() *http.
|
||||
if err != nil {
|
||||
errLevel = ErrLevelRecoverableErr // 读取数据错误,或数据格式错误认为是偶发情况,重试
|
||||
} else {
|
||||
errLevel, err = handleResponse(bodyMap)
|
||||
errLevel, err = handleResponse(response, bodyMap)
|
||||
}
|
||||
if err == nil {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user