Skip to content

Commit

Permalink
fix(backup): restore sending error response to soon
Browse files Browse the repository at this point in the history
  • Loading branch information
polonel committed Jan 9, 2019
1 parent 32a4e87 commit 605c8d8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/controllers/backuprestore.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@ backup_restore.restoreBackup = function(req, res) {
child.kill('SIGINT');
global.forks = _.remove(global.forks, function(f) { return f.fork !== child; });

if (data.error) return res.status(400).json({success: false, error: data.error});
if (data.error) {
result = {success: false, error: data.error};
return;
}

if (data.success) {
var cache = _.find(global.forks, function(f) { return f.name === 'cache'; });
Expand Down

0 comments on commit 605c8d8

Please sign in to comment.