Rework the progress API to use the task progress

This commit is contained in:
Girish Ramakrishnan
2018-11-19 20:01:02 -08:00
parent 218739a6b5
commit 305a3c94d0
10 changed files with 18 additions and 136 deletions

View File

@@ -2,7 +2,6 @@
exports = module.exports = {
reboot: reboot,
getProgress: getProgress,
getConfig: getConfig,
getDisks: getDisks,
getUpdateInfo: getUpdateInfo,
@@ -22,7 +21,6 @@ var appstore = require('../appstore.js'),
CloudronError = cloudron.CloudronError,
HttpError = require('connect-lastmile').HttpError,
HttpSuccess = require('connect-lastmile').HttpSuccess,
progress = require('../progress.js'),
updater = require('../updater.js'),
updateChecker = require('../updatechecker.js'),
UpdaterError = require('../updater.js').UpdaterError,
@@ -33,10 +31,6 @@ function auditSource(req) {
return { ip: ip, username: req.user ? req.user.username : null, userId: req.user ? req.user.id : null };
}
function getProgress(req, res, next) {
return next(new HttpSuccess(200, progress.getAll()));
}
function reboot(req, res, next) {
// Finish the request, to let the appstore know we triggered the restore it
next(new HttpSuccess(202, {}));