aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRemy Raes <raes.remy@gmail.com>2022-01-10 17:07:10 +0100
committerRemy Raes <raes.remy@gmail.com>2022-01-10 17:07:10 +0100
commitb71a948c8295bf1e55d2bd32f270b65280ba2b26 (patch)
tree08cb7253000a472ef84e4028a5168ed8e3f3f471
parent3bb33d94b47764d8ee8b6b7df0aef1573e55078d (diff)
downloadViper-b71a948c8295bf1e55d2bd32f270b65280ba2b26.tar.gz
Viper-b71a948c8295bf1e55d2bd32f270b65280ba2b26.zip
[fix] checking for updates on viper launch
-rw-r--r--src/utils.js14
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();
}