Update documents in batches is sending the same chunk all the time
brunoocasali opened this issue · comments
In this function updateDocumentsInBatches
we use a method called self::batch
to split a big array into smaller chunks to improve the performance.
But after doing that, we are sending the same $documents
array where it should be $batch
:
// current:
foreach (self::batch($documents, $batchSize) as $batch) {
$promises[] = $this-> updateDocuments($documents, $primaryKey);
}
// should be:
foreach (self::batch($documents, $batchSize) as $batch) {
$promises[] = $this-> updateDocuments($batch, $primaryKey);
}
This is the affected code:
We should also fix this testAddDocumentsInBatches
test case.