From c2c12f1178e918a028781d0bd2b6d019794d883d Mon Sep 17 00:00:00 2001 From: Aetherinox Date: Sat, 20 Jul 2024 03:03:43 -0700 Subject: [PATCH] change: add interval const for 5s --- index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 5a1b4d8..f8f04cf 100644 --- a/index.js +++ b/index.js @@ -41,6 +41,7 @@ let bQuitOnClose = 0; */ const _Instance = 'https://ntfy.sh/app'; +const _Interval = 5; /* Declare > Store Values @@ -672,7 +673,7 @@ function ready() { async function GetMessages() { const cfgTopics = store.get('topics'); const cfgInstanceURL = store.get('instanceURL'); - const uri = `${cfgInstanceURL}/${cfgTopics}/json?since=10s&poll=1`; + const uri = `${cfgInstanceURL}/${cfgTopics}/json?since=${_Interval}s&poll=1`; const json = await GetMessageData(uri); /* @@ -733,7 +734,7 @@ function ready() { Run timer every X seconds to check for new messages */ - const fetchInterval = 10500; + const fetchInterval = (_Interval * 1000) + 600; setInterval(GetMessages, fetchInterval); }