Automatically restart Laravel Horizon
justbetter/laravel-horizon-restarter is a Laravel package for automatically restart laravel horizon.
It currently has 2 GitHub stars and 6.887 downloads on Packagist (latest version 1.1.0).
Install it with composer require justbetter/laravel-horizon-restarter.
Discover more Laravel packages by justbetter
or browse all Laravel packages to compare alternatives.
Last updated
Automatically restart Horizon after a given amount of jobs.
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.
You can install the package via composer:
composer require justbetter/laravel-horizon-restarter
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
To ensure the quality of this package, run the following command:
composer quality
This will execute three tasks:
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.