diff --git a/bin/commands/runs.js b/bin/commands/runs.js index d2c4aa5c..960e8bfd 100644 --- a/bin/commands/runs.js +++ b/bin/commands/runs.js @@ -18,7 +18,6 @@ const archiver = require("../helpers/archiver"), {initTimeComponents, instrumentEventTime, markBlockStart, markBlockEnd, getTimeComponents} = require('../helpers/timeComponents'), downloadBuildArtifacts = require('../helpers/buildArtifacts').downloadBuildArtifacts, downloadBuildStacktrace = require('../helpers/downloadBuildStacktrace').downloadBuildStacktrace, - updateNotifier = require('update-notifier'), pkg = require('../../package.json'), packageDiff = require('../helpers/package-diff'); const { getStackTraceUrl } = require('../helpers/sync/syncSpecsLogs'); @@ -531,23 +530,27 @@ module.exports = function run(args, rawArgs) { utils.sendUsageReport(bsJsonData, args, err.message, Constants.messageTypes.ERROR, utils.getErrorCodeFromErr(err), null, rawArgs); process.exitCode = Constants.ERROR_EXIT_CODE; }).finally(function(){ - const notifier = updateNotifier({ - pkg, - updateCheckInterval: 1000 * 60 * 60 * 24 * 7, - }); + import('update-notifier').then(({ default: updateNotifier } ) => { + const notifier = updateNotifier({ + pkg, + updateCheckInterval: 1000 * 60 * 60 * 24 * 7, + }); - // Checks for update on first run. - // Set lastUpdateCheck to 0 to spawn the check update process as notifier sets this to Date.now() for preventing - // the check untill one interval period. It runs once. - if (!notifier.disabled && Date.now() - notifier.config.get('lastUpdateCheck') < 50) { - notifier.config.set('lastUpdateCheck', 0); - notifier.check(); - } + // Checks for update on first run. + // Set lastUpdateCheck to 0 to spawn the check update process as notifier sets this to Date.now() for preventing + // the check untill one interval period. It runs once. + if (!notifier.disabled && Date.now() - notifier.config.get('lastUpdateCheck') < 50) { + notifier.config.set('lastUpdateCheck', 0); + notifier.check(); + } - // Set the config update as notifier clears this after reading. - if (notifier.update && notifier.update.current !== notifier.update.latest) { - notifier.config.set('update', notifier.update); - notifier.notify({isGlobal: true}); - } + // Set the config update as notifier clears this after reading. + if (notifier.update && notifier.update.current !== notifier.update.latest) { + notifier.config.set('update', notifier.update); + notifier.notify({isGlobal: true}); + } + }).catch((error) => { + logger.debug('Got error loading update-notifier: ', error); + }); }); } diff --git a/package.json b/package.json index 158e593f..b6dd08da 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "request": "2.88.2", "requestretry": "7.1.0", "table": "5.4.6", - "update-notifier": "5.1.0", + "update-notifier": "7.0.0", "uuid": "8.3.2", "windows-release": "^5.1.0", "winston": "2.4.4",