Skip to content

Commit

Permalink
BUGFIX: Persist changes to assets
Browse files Browse the repository at this point in the history
Changes should be persistet when the command terminates
  • Loading branch information
daniellienert committed Jan 4, 2018
1 parent be80dd0 commit 7dda953
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Classes/Command/MetaDataCommandController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -29,6 +30,12 @@ class MetaDataCommandController extends CommandController
*/
protected $extractionManager;

/**
* @Flow\Inject
* @var PersistenceManager
*/
protected $persistenceManager;

/**
* Extracts MetaData from Assets
*/
Expand All @@ -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.");
}
}

0 comments on commit 7dda953

Please sign in to comment.