Add missing error handlers to checkpoints()
This commit is contained in:
parent
8a1fe0b744
commit
8493ede19e
|
@ -976,13 +976,15 @@ function tryReplicate(sourceModel, targetModel, since, options, callback) {
|
||||||
function checkpoints() {
|
function checkpoints() {
|
||||||
var cb = arguments[arguments.length - 1];
|
var cb = arguments[arguments.length - 1];
|
||||||
sourceModel.checkpoint(function(err, source) {
|
sourceModel.checkpoint(function(err, source) {
|
||||||
|
if (err) return cb(err);
|
||||||
newSourceCp = source.seq;
|
newSourceCp = source.seq;
|
||||||
targetModel.checkpoint(function(err, target) {
|
targetModel.checkpoint(function(err, target) {
|
||||||
|
if (err) return cb(err);
|
||||||
newTargetCp = target.seq;
|
newTargetCp = target.seq;
|
||||||
debug('\tcreated checkpoints');
|
debug('\tcreated checkpoints');
|
||||||
debug('\t\t%s for source model %s', newSourceCp, sourceModel.modelName);
|
debug('\t\t%s for source model %s', newSourceCp, sourceModel.modelName);
|
||||||
debug('\t\t%s for target model %s', newTargetCp, targetModel.modelName);
|
debug('\t\t%s for target model %s', newTargetCp, targetModel.modelName);
|
||||||
cb(err);
|
cb();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue