mirror of
https://github.com/zhigang1992/probot.git
synced 2026-04-29 04:35:26 +08:00
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:
committed by
Bex Warner
parent
6c2cc02e83
commit
8df333ccf8
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user