Skip to content
This repository was archived by the owner on Dec 9, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/Replication.php
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,10 @@ public function locateChangedDocumentsAndReplicate($printStatus, $getFinalReport
$since = $this->task->getSinceSeq();
$style = $this->task->getStyle();
while (1) {
if (getenv('REPLICATION_DEBUG')) {
$count = count($revDiff);
print "Requesting changed revisions (since $since); revisions determined changed: $count \n";
}
$changes = $this->source->getChanges(
array(
'feed' => 'normal',
Expand Down Expand Up @@ -464,7 +468,9 @@ public function locateChangedDocumentsAndReplicate($printStatus, $getFinalReport
}
$since = $changes['last_seq'];
}

if (getenv('REPLICATION_DEBUG')) {
print "Starting replicating changes for $count revisions...\n";
}
$response = $this->replicateChanges($revDiff);
$finalResponse['doc_write_failures'] = 0;
$finalResponse['docs_written'] = 0;
Expand Down Expand Up @@ -545,8 +551,16 @@ public function replicateChanges(array &$revDiff)
// transferred revision that had attachment in the current doc.
$allResponse['multipartResponse'][$docId] = $multipartResponse;
}
if (getenv('REPLICATION_DEBUG')) {
print "Resolved missing revisions: ${allResponse['docs_read']} documents read, ${allResponse['missing_checked']} revisions processed in total. \n";
}
$allResponse['bulkResponse'] += $bulkUpdater->executeByLimit($bulkDocsLimit);
if (getenv('REPLICATION_DEBUG')) {
$num_docs = count($docStack);
print "Bulk updated $num_docs documents. \n";
}
$bulkUpdater->emptyDocuments();

}
return $allResponse;
}
Expand Down