Skip to content

Commit

Permalink
simplify createJob calls
Browse files Browse the repository at this point in the history
  • Loading branch information
mfix22 committed Feb 21, 2022
1 parent f6abec3 commit fc59da5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
12 changes: 7 additions & 5 deletions src/pull/labeled.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,13 @@ module.exports = (queue) => async (context) => {

return (
queue
.createJob({
...context.pullRequest({ installation_id: context.payload.installation.id }),
action: MERGE,
method,
})
.createJob(
context.pullRequest({
installation_id: context.payload.installation.id,
action: MERGE,
method,
})
)
.setId(ID)
// https://github.com/reporanger/feedback/issues/1
.delayUntil(Date.now() + PULL_REQUEST_MERGE_DELAY)
Expand Down
7 changes: 3 additions & 4 deletions src/thread/closed.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ module.exports = (queue) => async (context) => {
return executeAction(action, {
[LOCK]: () => {
return queue
.createJob({
...context.issue({ installation_id: context.payload.installation.id }),
action: LOCK,
})
.createJob(
context.issue({ installation_id: context.payload.installation.id, action: LOCK })
)
.setId(getId(context, { action: LOCK }))
.delayUntil(Date.now() + ms(delay))
.save()
Expand Down

0 comments on commit fc59da5

Please # to comment.