Skip to content

Commit 494c5af

Browse files
PWalkowsaimaz
authored andcommitted
Fix for memory problem in export index (#879)
As file value was used to store all of the documents it stopped the script when the value was getting too big due to number of documents stored in it. Value was not used so I just removed it.
1 parent b2e4002 commit 494c5af

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

Service/ExportService.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ public function exportIndex(
8282
$filename = str_replace('.json', '', $filename);
8383
$writer = $this->getWriter($this->getFilePath($filename.'.json'), $metadata);
8484

85-
$file = [];
8685
foreach ($results as $data) {
8786
if ($counter >= $maxLinesInFile) {
8887
$writer->finalize();
@@ -99,7 +98,6 @@ public function exportIndex(
9998

10099
$doc = array_intersect_key($data, array_flip(['_id', '_type', '_source']));
101100
$writer->push($doc);
102-
$file[] = $doc;
103101
$progress->advance();
104102
$counter++;
105103
}

0 commit comments

Comments
 (0)