make funcs take proper callbacks

This commit is contained in:
Girish Ramakrishnan
2019-03-07 14:27:23 -08:00
parent 4d50bd5c78
commit a9d6ac29f1
2 changed files with 5 additions and 6 deletions

View File

@@ -13,6 +13,7 @@ exports = module.exports = {
var apps = require('./apps.js'),
appstore = require('./appstore.js'),
assert = require('assert'),
async = require('async'),
constants = require('./constants.js'),
debug = require('debug')('box:updatechecker'),
@@ -24,8 +25,6 @@ var apps = require('./apps.js'),
var gAppUpdateInfo = { }, // id -> update info { creationDate, manifest }
gBoxUpdateInfo = null; // { version, changelog, upgrade, sourceTarballUrl }
var NOOP_CALLBACK = function (error) { if (error) debug(error); };
function loadState() {
var state = safe.JSON.parse(safe.fs.readFileSync(paths.UPDATE_CHECKER_FILE, 'utf8'));
return state || { };
@@ -62,7 +61,7 @@ function resetAppUpdateInfo(appId) {
}
function checkAppUpdates(callback) {
callback = callback || NOOP_CALLBACK; // null when called from a timer task
assert.strictEqual(typeof callback, 'function');
debug('Checking App Updates');
@@ -133,7 +132,7 @@ function checkAppUpdates(callback) {
}
function checkBoxUpdates(callback) {
callback = callback || NOOP_CALLBACK; // null when called from a timer task
assert.strictEqual(typeof callback, 'function');
debug('Checking Box Updates');