diff options
author | Remy Raes <raes.remy@gmail.com> | 2022-01-10 17:07:10 +0100 |
---|---|---|
committer | Remy Raes <raes.remy@gmail.com> | 2022-01-10 17:07:10 +0100 |
commit | b71a948c8295bf1e55d2bd32f270b65280ba2b26 (patch) | |
tree | 08cb7253000a472ef84e4028a5168ed8e3f3f471 | |
parent | 3bb33d94b47764d8ee8b6b7df0aef1573e55078d (diff) | |
download | Viper-b71a948c8295bf1e55d2bd32f270b65280ba2b26.tar.gz Viper-b71a948c8295bf1e55d2bd32f270b65280ba2b26.zip |
[fix] checking for updates on viper launch
-rw-r--r-- | src/utils.js | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/utils.js b/src/utils.js index c06aca1..eeeb1da 100644 --- a/src/utils.js +++ b/src/utils.js @@ -38,7 +38,7 @@ if (fs.existsSync("viper.json")) { northstar_auto_updates: { if (!settings.autoupdate) break northstar_auto_updates; - setInterval(async _ => { + async function _checkForUpdates() { const localVersion = getNSVersion(); const distantVersion = await requests.getLatestNsVersion(); console.log('Checking for Northstar updates...'); @@ -49,10 +49,14 @@ northstar_auto_updates: { } else { console.log('No Northstar update available.') } - }, - - // update checking interval must be bigger than cache validity duration - 15 * 60 * 1000); + + setTimeout( + _checkForUpdates, + 15 * 60 * 1000 // update checking interval must be bigger than cache validity duration + ); + } + + _checkForUpdates(); } |