- ebai限访问频率按门店来
This commit is contained in:
@@ -63,7 +63,7 @@ func New(source, secret string, config ...*platformapi.APIConfig) *API {
|
||||
secret: secret,
|
||||
client: &http.Client{Timeout: curConfig.ClientTimeout},
|
||||
config: &curConfig,
|
||||
speedLimiter: platformapi.New(apiLimitConfigs, defaultAPILimitConfig),
|
||||
speedLimiter: platformapi.New(apiLimitConfigs, nil), //defaultAPILimitConfig),
|
||||
storeCookies: make(map[string]string),
|
||||
}
|
||||
return api
|
||||
@@ -96,7 +96,7 @@ func (a *API) getShopID(body map[string]interface{}) (shopID string) {
|
||||
func (a *API) AccessAPI(cmd string, body map[string]interface{}) (retVal *ResponseResult, err error) {
|
||||
baseapi.SugarLogger.Debugf("ebai AccessAPI cmd:%s", cmd)
|
||||
// a.speedLimiter.AccessAPI(allAPI)
|
||||
a.speedLimiter.AccessAPI(cmd)
|
||||
a.speedLimiter.AccessAPI(cmd, a.getShopID(body))
|
||||
if body == nil {
|
||||
body = make(map[string]interface{}, 0)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user