edouardcourty/retryable-command
Retry commands if they fail, based on Symfony Commands
Maintainers
Package info
github.com/EdouardCourty/retryable-command
pkg:composer/edouardcourty/retryable-command
Requires
- php: >=7.4
- symfony/console: ^5.0|^6.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.37
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^10.4
Suggests
None
Provides
None
Conflicts
None
Replaces
None
ISC 6877dcbe12527af507ec99a0797b9fe369fc767f
- Edouard Courty <edouard.courty2.woop@gmail.com>
This package is auto-updated.
Last update: 2026-06-29 02:14:06 UTC
README
This library adds a retry feature to Symfony Commands.
Usage
To make a command retryable, make it extend RetryableCommand\Command\RetryableCommand.
To configure how many retries the command will do, you can either:
- Use the
setMaxRetrycommand inside theconfiguremethod - Use the
max-retryCLI option when calling the command
The sleep timeout is calculated using the retryTimeout that has to be implemented.
If you don't want to wait between retries, simply return 0.
This method accepts the current retry as a parameter, making it possible to compute dynamic retry timeouts depending on how many retries have been done already.
Contributing
If you wish to contribute to this project, feel free to submit a PR explaining your changes, and make sure to test your addition.
The pipeline has to be passing.
© - Edouard Courty
