Skip to content

Commit

Permalink
open browser on refresh and auto refresh every 30min
Browse files Browse the repository at this point in the history
  • Loading branch information
lluisd committed May 22, 2024
1 parent 1e887fa commit 6b7f804
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/notifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ class Notifier {

cron.schedule('0/15 * * * *', async () => {
await handlers.stream.sendTodayBirthday(this.twitchBot, this.target)
})

cron.schedule('0/30 * * * *', async () => {
await handlers.stream.refreshPage()
})

Expand Down
2 changes: 2 additions & 0 deletions services/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ async function refreshPage() {
const pageIsOpen = await browserApi.checkIfPageIsOpen()
if (browserIsOpen && pageIsOpen) {
await browserApi.refreshPage()
} else {
await startAndWarmUpBrowserIfNeeded()
}
}

Expand Down

0 comments on commit 6b7f804

Please sign in to comment.