Skip to content

Commit

Permalink
change: add interval const for 5s
Browse files Browse the repository at this point in the history
  • Loading branch information
Aetherinox committed Jul 20, 2024
1 parent 9847804 commit c2c12f1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ let bQuitOnClose = 0;
*/

const _Instance = 'https://ntfy.sh/app';
const _Interval = 5;

/*
Declare > Store Values
Expand Down Expand Up @@ -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);

/*
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit c2c12f1

Please sign in to comment.