test: remove useless code

This commit is contained in:
DIYgod
2019-01-29 17:15:02 +08:00
parent 079646387f
commit 6ef8957e8f
6 changed files with 593 additions and 598 deletions

View File

@@ -2,6 +2,7 @@
const lru = require('lru-cache');
const common = require('./cache-common');
const md5 = require('../utils/md5');
module.exports = function(options = {}) {
const {
@@ -41,7 +42,7 @@ module.exports = function(options = {}) {
return async function cache(ctx, next) {
const { url, path } = ctx.request;
const resolvedPrefix = typeof prefix === 'function' ? prefix.call(ctx, ctx) : prefix;
const key = resolvedPrefix + common.md5(ignoreQuery ? path : url);
const key = resolvedPrefix + md5(ignoreQuery ? path : url);
const tkey = key + ':type';
const validityCheck = common.validityCheck(routes, exclude, path);