Merge branch 'feature/qps' of git.yoho.cn:fe/yohobuy-node into feature/qps
Showing
1 changed file
with
4 additions
and
0 deletions
@@ -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); |
-
Please register or login to post a comment