diff --git a/src/menubar.js b/src/menubar.js index 8f07a96..ebdcac4 100644 --- a/src/menubar.js +++ b/src/menubar.js @@ -31,6 +31,15 @@ module.exports.init = async function(options = {}) { opener('http://localhost:9199') }, }, + { + title: 'Check Now', + tooltip: null, + checked: false, + enabled: true, + handler: async () => { + await server.restartIntervals() + }, + }, { title: 'Launch on Startup', tooltip: null, diff --git a/src/server.js b/src/server.js index 9796c18..7e54c94 100644 --- a/src/server.js +++ b/src/server.js @@ -265,7 +265,7 @@ async function sendMail(fromEmail, toEmail, videoDoc, channel) { }) } -function restartIntervals() { +module.exports.restartIntervals = function() { for (let i = 0; i < intervals.length; i++) { clearInterval(intervals[i]) } @@ -279,7 +279,7 @@ function restartIntervals() { intervals.push(interval) } } -restartIntervals() +module.exports.restartIntervals() const wss = new WebSocket.Server({ noServer: true }) let connection = null