backup can now be stopped

track the backup process and killable
This commit is contained in:
Girish Ramakrishnan
2018-11-17 19:53:15 -08:00
parent 6d971b9235
commit 8267279779
5 changed files with 48 additions and 20 deletions

View File

@@ -26,7 +26,7 @@ function backup(req, res, next) {
// note that cloudron.backup only waits for backup initiation and not for backup to complete
// backup progress can be checked up ny polling the progress api call
var auditSource = { userId: null, username: 'sysadmin' };
backups.runBackupTask(auditSource, function (error) {
backups.startBackupTask(auditSource, function (error) {
if (error && error.reason === BackupsError.BAD_STATE) return next(new HttpError(409, error.message));
if (error) return next(new HttpError(500, error));