app: expose cache function to koa context
This commit is contained in:
parent
1b11cd34ff
commit
ca0754d7b0
2
index.js
2
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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue