justbetter / laravel-horizon-restarter
Automatically restart Laravel Horizon
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 5
Forks: 0
Open Issues: 0
Type:package
Requires
- php: ^8.3
- laravel/framework: ^11.0|^12.0
- laravel/horizon: ^5.0
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.21
- orchestra/testbench: ^9.10
- pestphp/pest: ^3.7
- phpunit/phpunit: ^11.5
README
Laravel Horizon Restarter
Automatically restart Horizon after a given amount of jobs.
Why?
PHP is not designed for long running processes, it can sometimes run into issues when it has been running for too long. Horizon workers can automatically be stopped after processing a configured amount of jobs (maxjobs). However, depending on the balanceMaxShift and balanceCooldown, it may take a while before all processes are running again. This package will automatically restart Horizon gracefully after a given amount of jobs have been processed.
This package is to simplify configuration and to ensure that Horizon is restarted automatically.
Installation
You can install the package via composer:
composer require justbetter/laravel-horizon-restarter
Configuration
By default, after 100.000 jobs have been processed, Horizon will be terminated.
This can be configured by adding the following to your .env
file:
HORIZON_RESTARTER_THRESHOLD=100000
Quality
To ensure the quality of this package, run the following command:
composer quality
This will execute three tasks:
- Makes sure all tests are passed
- Checks for any issues using static code analysis
- Checks if the code is correctly formatted
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.