Skip to content
This repository has been archived by the owner on Sep 14, 2020. It is now read-only.
/ pr-police Public archive

Commit

Permalink
feat: only get pull requests on a fixed hour
Browse files Browse the repository at this point in the history
This is just a quick hack make sure that the pull requests are only
fetched and sent to configured channels on a fixed hour of the day.
  • Loading branch information
rogeriopvl committed May 3, 2017
1 parent 4767f3e commit 914641d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@ module.exports = function server () {

bot.on('start', () => {
setInterval(() => {
getPullRequests()
.then(buildMessage)
.then(notifyAllChannels)
const currentDate = new Date()
console.log('Running at: ' + currentDate.toString())
if (currentDate.getHours() === 1) {
getPullRequests()
.then(buildMessage)
.then(notifyAllChannels)
}
}, checkInterval)
})

Expand Down

0 comments on commit 914641d

Please sign in to comment.