Skip to content

Commit

Permalink
Merge pull request #370 from sigwinhq/perf/gc
Browse files Browse the repository at this point in the history
fix: allow importer/exporter to run GC each 50 items
  • Loading branch information
dpfaffenbauer authored Sep 27, 2022
2 parents e1e4904 + c875927 commit 5a007b1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/DataDefinitionsBundle/Exporter/Exporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ private function runExport(
UnpublishedHelper::hideUnpublished(
function () use ($definition, $params, $total, $fetcher, $provider, $fetcherContext) {
$count = 0;
$countToClean = 1000;
$perLoop = 50;
$perRun = ceil($total / $perLoop);

Expand All @@ -134,7 +133,7 @@ function () use ($definition, $params, $total, $fetcher, $provider, $fetcherCont
try {
$this->exportRow($definition, $object, $params, $provider);

if (($count + 1) % $countToClean === 0) {
if (($count + 1) % $perLoop === 0) {
Pimcore::collectGarbage();
$this->logger->info('Clean Garbage');
$this->eventDispatcher->dispatch(
Expand Down
2 changes: 1 addition & 1 deletion src/DataDefinitionsBundle/Importer/Importer.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ private function runImport(
}

$count = 0;
$countToClean = 1000;
$countToClean = 50;
$objectIds = [];
$exceptions = [];

Expand Down

0 comments on commit 5a007b1

Please sign in to comment.