Add tasks table and API

progress will be tracked with this table instead of being in-process
like progress.js
This commit is contained in:
Girish Ramakrishnan
2018-11-16 11:13:03 -08:00
parent 390e69c01c
commit 218739a6b5
11 changed files with 259 additions and 52 deletions

View File

@@ -2,8 +2,7 @@
exports = module.exports = {
list: list,
startBackup: startBackup,
stopBackup: stopBackup
startBackup: startBackup
};
var backupdb = require('../backupdb.js'),
@@ -42,12 +41,3 @@ function startBackup(req, res, next) {
next(new HttpSuccess(202, {}));
});
}
function stopBackup(req, res, next) {
backups.stopBackupTask(auditSource(req), function (error) {
if (error && error.reason === BackupsError.BAD_STATE) return next(new HttpError(409, error.message));
if (error) return next(new HttpError(500, error));
next(new HttpSuccess(202, {}));
});
}