Skip to content

Commit b0e2823

Browse files
SouravSourav
authored andcommitted
added code comments
1 parent d7ba65e commit b0e2823

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

bin/commands/runs.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,12 +328,16 @@ module.exports = function run(args, rawArgs) {
328328
pkg,
329329
updateCheckInterval: 1000 * 60 * 60 * 24 * 7,
330330
});
331-
331+
332+
// Checks for update on first run.
333+
// Set lastUpdateCheck to 0 to spawn the check update process as notifier sets this to Date.now() for preventing
334+
// the check untill one interval period. It runs once.
332335
if (!notifier.disabled && Date.now() - notifier.config.get('lastUpdateCheck') < 50) {
333336
notifier.config.set('lastUpdateCheck', 0);
334337
notifier.check();
335338
}
336339

340+
// Set the config update as notifier clears this after reading.
337341
if (notifier.update && notifier.update.current !== notifier.update.latest) {
338342
notifier.config.set('update', notifier.update);
339343
notifier.notify({isGlobal: true});

0 commit comments

Comments
 (0)