Skip to content

Commit

Permalink
💡 Refresh feeds after timeout
Browse files Browse the repository at this point in the history
It prevents creating duplicate issue/PR
  • Loading branch information
re-fort committed Dec 29, 2017
1 parent 71c171d commit 602d1dc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ let github = new Github()
// let slack = new Slack({ token: process.env.SLACK_TOKEN })

let startUpTime = new Date().toISOString()
let timer = null

let remote = {
origin: {
Expand Down Expand Up @@ -105,7 +106,8 @@ const setupUpstreamFeeder = () => {
if (startUpTime < item.date.toISOString()) {
Utility.log('I', `New commit on upstream repo: ${item.title}`)
removeHeadFeeder()
setupHeadFeeder()
clearTimeout(timer)
timer = setTimeout(() => setupHeadFeeder(), 300000)
}
})
}
Expand Down

0 comments on commit 602d1dc

Please sign in to comment.