Skip to content

Commit

Permalink
Fix issues with Provider's batch_size and PopulateCommand's batch_size
Browse files Browse the repository at this point in the history
  • Loading branch information
merk committed Mar 27, 2015
1 parent 8d8b04e commit b6e01cd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG-3.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 3 additions & 1 deletion Command/PopulateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,13 @@ protected function execute(InputInterface $input, OutputInterface $output)
$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 */
Expand Down
2 changes: 2 additions & 0 deletions Provider/AbstractProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ abstract protected function enableLogging($logger);
*/
protected function configureOptions()
{
$this->resolver->setAllowedTypes('batch_size', 'int');

This comment has been minimized.

Copy link
@miklos-martin

miklos-martin Mar 30, 2015

This one is a catchable fatal error prior to symfony 2.6.

This comment has been minimized.

Copy link
@merk

merk Apr 1, 2015

Author Member

Please create issues instead of commenting on PRs. These comments are generally lost.

This comment has been minimized.

Copy link
@merk

merk Apr 1, 2015

Author Member

*commenting on commits

This comment has been minimized.

Copy link
@miklos-martin

miklos-martin Apr 2, 2015

Next time I will. Thank you for the fix.


$this->resolver->setDefaults(array(
'batch_size' => 100,
'skip_indexable_check' => false,
Expand Down

0 comments on commit b6e01cd

Please sign in to comment.