From 7dda9536004ab2cf488d6e865604ffaf13bc206e Mon Sep 17 00:00:00 2001 From: Daniel Lienert Date: Thu, 4 Jan 2018 17:10:37 +0100 Subject: [PATCH] BUGFIX: Persist changes to assets Changes should be persistet when the command terminates --- Classes/Command/MetaDataCommandController.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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."); } }