(change, pending, lastSeq)
| 10071 | } |
| 10072 | |
| 10073 | function onChange(change, pending, lastSeq) { |
| 10074 | /* istanbul ignore if */ |
| 10075 | if (returnValue.cancelled) { |
| 10076 | return completeReplication(); |
| 10077 | } |
| 10078 | // Attach 'pending' property if server supports it (CouchDB 2.0+) |
| 10079 | /* istanbul ignore if */ |
| 10080 | if (typeof pending === 'number') { |
| 10081 | pendingBatch.pending = pending; |
| 10082 | } |
| 10083 | |
| 10084 | var filter = filterChange(opts)(change); |
| 10085 | if (!filter) { |
| 10086 | // update processed items count by 1 |
| 10087 | var task = src.activeTasks.get(taskId); |
| 10088 | if (task) { |
| 10089 | // we can assume that task exists here? shouldn't be deleted by here. |
| 10090 | var completed = task.completed_items || 0; |
| 10091 | src.activeTasks.update(taskId, {completed_items: ++completed}); |
| 10092 | } |
| 10093 | return; |
| 10094 | } |
| 10095 | pendingBatch.seq = change.seq || lastSeq; |
| 10096 | pendingBatch.changes.push(change); |
| 10097 | returnValue.emit('checkpoint', { 'pending_batch': pendingBatch.seq }); |
| 10098 | nextTick(function () { |
| 10099 | processPendingBatch(batches.length === 0 && changesOpts.live); |
| 10100 | }); |
| 10101 | } |
| 10102 | |
| 10103 | |
| 10104 | function onChangesComplete(changes) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…