- retry when 2101 for ebai page access

This commit is contained in:
gazebo
2019-03-12 15:22:37 +08:00
parent 6a5f399671
commit 2e1706ce3a
2 changed files with 6 additions and 1 deletions

View File

@@ -22,7 +22,8 @@ const (
)
const (
ResponseCodeSuccess = 0
ResponseCodeSuccess = 0
ResponseCodeCallElmFailed = 2101 // 这个可以尝试重试
)
const (

View File

@@ -78,6 +78,9 @@ func (a *API) AccessStorePage(subURL string) (retVal map[string]interface{}, err
return platformapi.ErrLevelSuccess, nil
}
newErr := utils.NewErrorIntCode(jsonResult1["errmsg"].(string), code)
if code == ResponseCodeCallElmFailed {
return platformapi.ErrLevelRecoverableErr, newErr
}
baseapi.SugarLogger.Debugf("ebai AccessStorePage failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
return platformapi.ErrLevelCodeIsNotOK, newErr
})
@@ -173,6 +176,7 @@ func (a *API) GetEleCommentList(fromTime, toTime time.Time, shopID, supplierID s
for _, orderComment := range commentMap["order_commentList"].([]interface{}) {
orderCommentMap := orderComment.(map[string]interface{})
orderCommentMap["order_id"] = commentMap["order_id"]
orderCommentMap["shop_id"] = commentMap["shop_id"]
commentList = append(commentList, orderComment.(map[string]interface{}))
}
}