Fix issues with Provider's batch_size and PopulateCommand's batch_size

This commit is contained in:
Tim Nagel 2015-03-27 11:45:03 +11:00
parent 8d8b04ead8
commit b6e01cd332
3 changed files with 11 additions and 1 deletions

View file

@ -9,6 +9,12 @@ https://github.com/FriendsOfSymfony/FOSElasticaBundle/commit/XXX where XXX is
the commit hash. To get the diff between two versions, go to
https://github.com/FriendsOfSymfony/FOSElasticaBundle/compare/v3.0.4...v3.1.0
* 3.1.1 (2015-03-27)
* Fix PopulateCommand trying to set formats for ProgressBar in Symfony < 2.5
* Fix Provider implementations that depend on a batch size from going into
infinite loops
* 3.1.0 (2015-03-18)
* BC BREAK: `Doctrine\Listener#scheduleForDeletion` access changed to private.

View file

@ -91,11 +91,13 @@ class PopulateCommand extends ContainerAwareCommand
$type = $input->getOption('type');
$reset = !$input->getOption('no-reset');
$options = array(
'batch_size' => $input->getOption('batch-size'),
'ignore_errors' => $input->getOption('ignore-errors'),
'offset' => $input->getOption('offset'),
'sleep' => $input->getOption('sleep')
);
if ($input->getOption('batch-size')) {
$options['batch_size'] = (int) $input->getOption('batch-size');
}
if ($input->isInteractive() && $reset && $input->getOption('offset')) {
/** @var DialogHelper $dialog */

View file

@ -104,6 +104,8 @@ abstract class AbstractProvider implements ProviderInterface
*/
protected function configureOptions()
{
$this->resolver->setAllowedTypes('batch_size', 'int');
$this->resolver->setDefaults(array(
'batch_size' => 100,
'skip_indexable_check' => false,