diff --git a/Classes/Command/MetaDataCommandController.php b/Classes/Command/MetaDataCommandController.php index 03faa4f..744f6fb 100644 --- a/Classes/Command/MetaDataCommandController.php +++ b/Classes/Command/MetaDataCommandController.php @@ -5,6 +5,7 @@ * This file is part of the Neos.MetaData.Extractor package. */ +use Neos\Flow\Persistence\Doctrine\PersistenceManager; use Neos\MetaData\Extractor\Domain\ExtractionManager; use Neos\MetaData\Extractor\Exception\ExtractorException; use Neos\Flow\Annotations as Flow; @@ -29,6 +30,12 @@ class MetaDataCommandController extends CommandController */ protected $extractionManager; + /** + * @Flow\Inject + * @var PersistenceManager + */ + protected $persistenceManager; + /** * Extracts MetaData from Assets */ @@ -47,8 +54,13 @@ public function extractCommand() } $this->output->progressAdvance(1); + + if($iterator->key() % 100 === 0) { + $this->persistenceManager->persistAll(); + } } + $this->persistenceManager->persistAll(); $this->outputLine("\nFinished extraction."); } }