Authored by 周少峰

Merge branch 'feature/qps' of git.yoho.cn:fe/yohobuy-node into feature/qps

@@ -42,6 +42,10 @@ function _cached(fn, ctx, ttl = HALF_MONTH) { @@ -42,6 +42,10 @@ function _cached(fn, ctx, ttl = HALF_MONTH) {
42 const args = Array.prototype.slice.call(arguments); 42 const args = Array.prototype.slice.call(arguments);
43 const key = pre + JSON.stringify(args || '[]'); 43 const key = pre + JSON.stringify(args || '[]');
44 44
  45 + if (!_.get(this.ctx.req.app.locals.pc, 'ci.tdk', false)) {
  46 + return Promise.resolve();
  47 + }
  48 +
45 return _cacheGet(key).catch(() => { 49 return _cacheGet(key).catch(() => {
46 return fn.apply(ctx, args).then(result => { 50 return fn.apply(ctx, args).then(result => {
47 _cacheSave(key, result, ttl); 51 _cacheSave(key, result, ttl);