Skip to content

Commit b6e01cd

Browse files
committed
Fix issues with Provider's batch_size and PopulateCommand's batch_size
1 parent 8d8b04e commit b6e01cd

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

CHANGELOG-3.1.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ https://github.com/FriendsOfSymfony/FOSElasticaBundle/commit/XXX where XXX is
99
the commit hash. To get the diff between two versions, go to
1010
https://github.com/FriendsOfSymfony/FOSElasticaBundle/compare/v3.0.4...v3.1.0
1111

12+
* 3.1.1 (2015-03-27)
13+
14+
* Fix PopulateCommand trying to set formats for ProgressBar in Symfony < 2.5
15+
* Fix Provider implementations that depend on a batch size from going into
16+
infinite loops
17+
1218
* 3.1.0 (2015-03-18)
1319

1420
* BC BREAK: `Doctrine\Listener#scheduleForDeletion` access changed to private.

Command/PopulateCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,13 @@ protected function execute(InputInterface $input, OutputInterface $output)
9191
$type = $input->getOption('type');
9292
$reset = !$input->getOption('no-reset');
9393
$options = array(
94-
'batch_size' => $input->getOption('batch-size'),
9594
'ignore_errors' => $input->getOption('ignore-errors'),
9695
'offset' => $input->getOption('offset'),
9796
'sleep' => $input->getOption('sleep')
9897
);
98+
if ($input->getOption('batch-size')) {
99+
$options['batch_size'] = (int) $input->getOption('batch-size');
100+
}
99101

100102
if ($input->isInteractive() && $reset && $input->getOption('offset')) {
101103
/** @var DialogHelper $dialog */

Provider/AbstractProvider.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ abstract protected function enableLogging($logger);
104104
*/
105105
protected function configureOptions()
106106
{
107+
$this->resolver->setAllowedTypes('batch_size', 'int');
108+
107109
$this->resolver->setDefaults(array(
108110
'batch_size' => 100,
109111
'skip_indexable_check' => false,

0 commit comments

Comments
 (0)