Adds missing awaits (#584)

Both `get` and `set` are async in the metadata library. The `await` in `get` is required in this case because otherwise it will always to set a promise on the metadata, which doesn't make sense, and the await in set is required to not swallow the rejection if it fails.
This commit is contained in:
Alberto Gimeno
2018-06-26 22:23:50 +02:00
committed by Bex Warner
parent 6c2cc02e83
commit 8df333ccf8

View File

@@ -73,7 +73,7 @@ const metadata = require('probot-metadata')
module.exports = app => {
app.on(['issues.edited', 'issue_comment.edited'], async context => {
const kv = await metadata(context)
kv.set('edits', kv.get('edits') || 1)
await kv.set('edits', await kv.get('edits') || 1)
})
app.on('issues.closed', async context => {