Authored by 毕凯

路径完善

... ... @@ -9,7 +9,7 @@ const MAX_QPS_10m = config.maxQps10m;
const _ = require('lodash');
const PAGES = {
'/product/^\/(\d+)\.html/': 5,
'/product/^\\/(\\d+)\\.html/': 5,
'/product/list/index': 5,
'/product/index/index': 5,
'/product/search/list': 5
... ... @@ -44,8 +44,8 @@ module.exports = (limiter, policy) => {
let pageIncr = PAGES[pageKey] || 0;
if (pageIncr > 0) {
cache.incrAsync(key, pageIncr, () => {});
cache.incrAsync(key10m, pageIncr, () => {});
cache.incrAsync(key, pageIncr);
cache.incrAsync(key10m, pageIncr);
}
});
... ... @@ -54,7 +54,7 @@ module.exports = (limiter, policy) => {
let result10m = results[key10m];
logger.debug('qps limiter: ' + key + '@' + result + ' max: ' + MAX_QPS);
logger.debug('qps limiter: ' + key10m + '@' + result10m + ' max: ' + MAX_QPS_10m);
logger.debug('qps limiter 10m: ' + key10m + '@' + result10m + ' max: ' + MAX_QPS_10m);
// 默认数据设置
if (!result && !_.isNumber(result)) {
... ...