unify update check into a single job

This commit is contained in:
Girish Ramakrishnan
2020-08-19 21:39:58 -07:00
parent 2eb0b5eedd
commit 6c4df5abf0
4 changed files with 31 additions and 27 deletions

View File

@@ -1,12 +1,11 @@
'use strict';
exports = module.exports = {
checkAppUpdates: checkAppUpdates,
checkBoxUpdates: checkBoxUpdates,
checkForUpdates,
getUpdateInfo: getUpdateInfo,
resetUpdateInfo: resetUpdateInfo,
resetAppUpdateInfo: resetAppUpdateInfo,
getUpdateInfo,
resetUpdateInfo,
resetAppUpdateInfo,
_setUpdateInfo: setUpdateInfo
};
@@ -171,3 +170,19 @@ function checkBoxUpdates(options, callback) {
});
});
}
function checkForUpdates(options, callback) {
assert.strictEqual(typeof options, 'object');
assert.strictEqual(typeof callback, 'function');
checkBoxUpdates(options, function (error) {
if (error) debug('checkForUpdates: error checking for box updates:', error);
checkAppUpdates(options, function (error) {
if (error) debug('checkForUpdates: error checking for app updates:', error);
callback();
});
});
}