Skip to content

Commit

Permalink
Merge pull request #13 from daniellienert/bugfix/persist-changes-to-a…
Browse files Browse the repository at this point in the history
…ssets

BUGFIX: Persist changes to assets
  • Loading branch information
daniellienert authored Jan 4, 2018
2 parents 2778d07 + 7dda953 commit 66ffd0a
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 66ffd0a

Please sign in to comment.