Merge pull request #1894 from strongloop/feature/improve-replication-debugging
PersistedModel: log rectify/rectifyAll triggers
This commit is contained in:
commit
b2c9c97c2c
|
@ -1442,6 +1442,13 @@ module.exports = function(registry) {
|
|||
var id = instance ? instance.getId() :
|
||||
getIdFromWhereByModelId(ctx.Model, ctx.where);
|
||||
|
||||
if (debug.enabled) {
|
||||
debug('rectifyOnSave %s -> ' + (id ? 'id %j' : '%s'),
|
||||
ctx.Model.modelName, id ? id : 'ALL');
|
||||
debug('context instance:%j currentInstance:%j where:%j data %j',
|
||||
ctx.instance, ctx.currentInstance, ctx.where, ctx.data);
|
||||
}
|
||||
|
||||
if (id) {
|
||||
ctx.Model.rectifyChange(id, reportErrorAndNext);
|
||||
} else {
|
||||
|
@ -1460,6 +1467,12 @@ module.exports = function(registry) {
|
|||
var id = ctx.instance ? ctx.instance.getId() :
|
||||
getIdFromWhereByModelId(ctx.Model, ctx.where);
|
||||
|
||||
if (debug.enabled) {
|
||||
debug('rectifyOnDelete %s -> ' + (id ? 'id %j' : '%s'),
|
||||
ctx.Model.modelName, id ? id : 'ALL');
|
||||
debug('context instance:%j where:%j', ctx.instance, ctx.where);
|
||||
}
|
||||
|
||||
if (id) {
|
||||
ctx.Model.rectifyChange(id, reportErrorAndNext);
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue