run backuptask as separate process

This commit is contained in:
Girish Ramakrishnan
2018-11-16 11:48:02 -08:00
parent 5c9b6736f0
commit 0b86070fe9
5 changed files with 80 additions and 18 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.backup(auditSource, function (error) {
backups.runBackupTask(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));