Only trigger cloudron retire and print any errors, but always succeed
This commit is contained in:
@@ -46,12 +46,9 @@ function update(req, res, next) {
|
||||
function retire(req, res, next) {
|
||||
debug('triggering retire');
|
||||
|
||||
// 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
|
||||
cloudron.retire(function (error) {
|
||||
if (error && error.reason === CloudronError.BAD_STATE) return next(new HttpError(409, error.message));
|
||||
if (error) return next(new HttpError(500, error));
|
||||
|
||||
next(new HttpSuccess(202, {}));
|
||||
if (error) console.error('Retire failed.', error);
|
||||
});
|
||||
|
||||
next(new HttpSuccess(202, {}));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user