Add missing error handlers to checkpoints()

This commit is contained in:
Miroslav Bajtoš 2015-04-02 14:14:32 +02:00
parent 8a1fe0b744
commit 8493ede19e
1 changed files with 3 additions and 1 deletions

View File

@ -976,13 +976,15 @@ function tryReplicate(sourceModel, targetModel, since, options, callback) {
function checkpoints() {
var cb = arguments[arguments.length - 1];
sourceModel.checkpoint(function(err, source) {
if (err) return cb(err);
newSourceCp = source.seq;
targetModel.checkpoint(function(err, target) {
if (err) return cb(err);
newTargetCp = target.seq;
debug('\tcreated checkpoints');
debug('\t\t%s for source model %s', newSourceCp, sourceModel.modelName);
debug('\t\t%s for target model %s', newTargetCp, targetModel.modelName);
cb(err);
cb();
});
});
}