MCPcopy
hub / github.com/strongloop/loopback / replicateExpectingSuccess

Function replicateExpectingSuccess

test/replication.test.js:1838–1854  ·  view source on GitHub ↗
(source, target, since)

Source from the content-addressed store, hash-verified

1836 }
1837
1838 function replicateExpectingSuccess(source, target, since) {
1839 if (!source) source = SourceModel;
1840 if (!target) target = TargetModel;
1841
1842 return function doReplicate(next) {
1843 replicate(source, target, since, function(err, conflicts, cps) {
1844 if (err) return next(err);
1845
1846 if (conflicts.length) {
1847 return next(new Error('Unexpected conflicts\n' +
1848 conflicts.map(JSON.stringify).join('\n')));
1849 }
1850
1851 next();
1852 });
1853 };
1854 }
1855
1856 function setupRaceConditionInReplication(fn) {
1857 const bulkUpdate = TargetModel.bulkUpdate;

Callers 2

syncFunction · 0.85

Calls 2

replicateFunction · 0.85
nextFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…