We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
With the following code, you can easily check if Laravel Horizon is active. Just create a custom Healthcheck.
<?php namespace App\HealthChecks; use Laravel\Horizon\Contracts\MasterSupervisorRepository; use UKFast\HealthCheck\HealthCheck; use UKFast\HealthCheck\Status; class HorizonHealthCheck extends HealthCheck { protected $name = 'horizon'; private MasterSupervisorRepository $masterSupervisorRepository; /** * @param MasterSupervisorRepository $masterSupervisorRepository */ public function __construct(MasterSupervisorRepository $masterSupervisorRepository) { $this->masterSupervisorRepository = $masterSupervisorRepository; } /** * @return Status */ public function status(): Status { if (! $masters = $this->masterSupervisorRepository->all()) { return $this->problem('Horizon is inactive.'); } return collect($masters)->contains(function ($master) { return $master->status === 'paused'; }) ? $this->problem('Horizon is paused.') : $this->okay(); } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
What is the feature?
With the following code, you can easily check if Laravel Horizon is active. Just create a custom Healthcheck.
The text was updated successfully, but these errors were encountered: