From ca0754d7b0cd33144cefe56610a2a61234ccbd59 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Fri, 18 May 2018 01:43:43 +0800 Subject: [PATCH] app: expose cache function to koa context --- index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.js b/index.js index f51e9daa6..b3d362651 100644 --- a/index.js +++ b/index.js @@ -55,6 +55,7 @@ app.use(filter); if (config.cacheType === 'memory') { app.use( memoryCache({ + app: app, expire: config.cacheExpire, ignoreQuery: true, }) @@ -62,6 +63,7 @@ if (config.cacheType === 'memory') { } else if (config.cacheType === 'redis') { app.use( redisCache({ + app: app, expire: config.cacheExpire, ignoreQuery: true, redis: config.redis,