app: expose cache function to koa context

This commit is contained in:
DIYgod 2018-05-18 01:43:43 +08:00
parent 1b11cd34ff
commit ca0754d7b0
No known key found for this signature in database
GPG Key ID: EC0B76A252D3EF67
1 changed files with 2 additions and 0 deletions

View File

@ -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,