Skip to content

Bump the version of update-notifier package #841

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 20 additions & 17 deletions bin/commands/runs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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);
});
});
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading