From b71a948c8295bf1e55d2bd32f270b65280ba2b26 Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Mon, 10 Jan 2022 17:07:10 +0100 Subject: [fix] checking for updates on viper launch --- src/utils.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src') 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(); } -- cgit v1.2.3