aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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();
}