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

@@ -24,7 +24,6 @@ exports = module.exports = {
};
let assert = require('assert'),
async = require('async'),
auditSource = require('../auditsource.js'),
BoxError = require('../boxerror.js'),
cloudron = require('../cloudron.js'),
@@ -204,10 +203,7 @@ function checkForUpdates(req, res, next) {
// it can take a while sometimes to get all the app updates one by one
req.clearTimeout();
async.series([
(done) => updateChecker.checkAppUpdates({ automatic: false }, done),
(done) => updateChecker.checkBoxUpdates({ automatic: false }, done),
], function () {
updateChecker.checkForUpdates({ automatic: false }, function () {
next(new HttpSuccess(200, { update: updateChecker.getUpdateInfo() }));
});
}