diff --git a/app/controllers/status.js b/app/controllers/status.js index 01b51b99..6652359e 100644 --- a/app/controllers/status.js +++ b/app/controllers/status.js @@ -45,8 +45,7 @@ exports.show = function(req, res, next) { } }; -exports.sync = function(req, res, next) { +exports.sync = function(req, res) { if (req.syncInfo) res.jsonp(req.syncInfo); - next(); }; diff --git a/lib/HistoricSync.js b/lib/HistoricSync.js index 2735f44f..f9d3d0a9 100644 --- a/lib/HistoricSync.js +++ b/lib/HistoricSync.js @@ -274,11 +274,13 @@ function spec() { }); } - if (!err) - sync(); - else { + if (err) { + self.syncInfo = util._extend(self.syncInfo, { error: err.message }); return next(err, 0); } + else { + sync(); + } }); };