(attempt, since)
| 1187 | return callback.promise; |
| 1188 | |
| 1189 | function run(attempt, since) { |
| 1190 | debug('\titeration #%s', attempt); |
| 1191 | tryReplicate(sourceModel, targetModel, since, options, next); |
| 1192 | |
| 1193 | function next(err, conflicts, cps, updates) { |
| 1194 | const finished = err || conflicts.length || |
| 1195 | !updates || updates.length === 0 || |
| 1196 | attempt >= MAX_ATTEMPTS; |
| 1197 | |
| 1198 | if (finished) |
| 1199 | return callback(err, conflicts, cps); |
| 1200 | run(attempt + 1, cps); |
| 1201 | } |
| 1202 | } |
| 1203 | }; |
| 1204 | |
| 1205 | function tryReplicate(sourceModel, targetModel, since, options, callback) { |
no test coverage detected