Skip to content

Commit 4050da4

Browse files
committed
2 parents 2ecaeb7 + b15efa7 commit 4050da4

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,23 @@ const { Application } = require('probot')
22
const { resolve } = require('probot/lib/resolver')
33
const { findPrivateKey } = require('probot/lib/private-key')
44
const { template } = require('./views/probot')
5+
const cacheManager = require('cache-manager')
56

67
let app
78
let probot
9+
let cache
810

911
const loadProbot = (plugin) => {
12+
cache = cache || cacheManager.caching({
13+
store: 'memory',
14+
ttl: 60 * 5 // 5 minutes
15+
})
16+
1017
app = app || new Application({
1118
id: process.env.APP_ID,
1219
secret: process.env.WEBHOOK_SECRET,
13-
cert: findPrivateKey()
20+
cert: findPrivateKey(),
21+
cache
1422
})
1523

1624
if (typeof plugin === 'string') {

0 commit comments

Comments
 (0)