Skip to content

Commit

Permalink
fix: batch size CLI option
Browse files Browse the repository at this point in the history
  • Loading branch information
priyadi committed Jul 17, 2024
1 parent abfa174 commit 4e94736
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions packages/rekapager-symfony-bridge/src/Batch/BatchCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function __construct()
parent::__construct();

$this->addOption('resume', 'r', InputOption::VALUE_OPTIONAL, 'Page identifier to resume from');
$this->addOption('pagesize', 'p', InputOption::VALUE_OPTIONAL, 'Batch/page/chunk size');
$this->addOption('page-size', 'p', InputOption::VALUE_OPTIONAL, 'Batch/page/chunk size');
$this->addOption('progress-file', 'f', InputOption::VALUE_OPTIONAL, 'Temporary file to store progress data');
$this->addOption('time-limit', 't', InputOption::VALUE_OPTIONAL, 'Runs the batch up to the specified time limit (in seconds)');
}
Expand Down Expand Up @@ -79,7 +79,7 @@ final protected function execute(InputInterface $input, OutputInterface $output)
// input checking

$resume = $input->getOption('resume');
$pageSize = $input->getOption('pagesize');
$pageSize = $input->getOption('page-size');
$progressFile = $input->getOption('progress-file');
$timeLimit = $input->getOption('time-limit');

Expand All @@ -89,7 +89,7 @@ final protected function execute(InputInterface $input, OutputInterface $output)
}

if (!is_numeric($pageSize) && $pageSize !== null) {
throw new InvalidArgumentException('Invalid pagesize option');
throw new InvalidArgumentException('Invalid page-size option');
}

if ($pageSize !== null) {
Expand Down
6 changes: 4 additions & 2 deletions tests/src/App/Command/AppSimpleBatchCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ public function __construct(
parent::__construct();
}

protected function getPageable(InputInterface $input, OutputInterface $output): PageableInterface
{
protected function getPageable(
InputInterface $input,
OutputInterface $output
): PageableInterface {
$adapter = new SelectableAdapter($this->postRepository);

return new KeysetPageable($adapter);
Expand Down

0 comments on commit 4e94736

Please sign in to comment.