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:
@@ -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, {}));
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user