Skip to content

Commit

Permalink
Add a retry-attempts option.
Browse files Browse the repository at this point in the history
  • Loading branch information
antoox committed Sep 18, 2014
1 parent 045194b commit 98df5fb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Command/SwarrotCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ protected function configure()
}
if (array_key_exists('retry', $this->processorStack)) {
$this->addOption('no-retry', 'R', InputOption::VALUE_NONE, 'Deactivate retry.');
$this->addOption('retry-attempts', null, InputOption::VALUE_REQUIRED, 'Number of maximum retry attempts (if it exists, override the extra data parameter)');
}
}

Expand Down Expand Up @@ -149,6 +150,10 @@ protected function getOptions(InputInterface $input)
if (isset($this->extras['retry_attempts'])) {
$attempts = $this->extras['retry_attempts'];
}

if ($input->hasOption('retry-attempts')) {
$attempts = (int) $input->getOption('retry-attempts');
}
$options['retry_attempts'] = $attempts;
}

Expand Down

0 comments on commit 98df5fb

Please sign in to comment.