diff --git a/app/HorizonHealthCheck.php b/app/HorizonHealthCheck.php new file mode 100644 index 0000000..171aeb1 --- /dev/null +++ b/app/HorizonHealthCheck.php @@ -0,0 +1,43 @@ +supervisorRepository->all(); + + if (count($masters) === 0) { + return $this->problem('Horizon is inactive'); + } + + return collect($masters)->contains( + static fn (object $master): bool => $master->status === 'paused' + ) ? $this->problem('Horizon is paused') : $this->okay(); + } +} diff --git a/config/healthcheck.php b/config/healthcheck.php index 8a6e77a..d505b97 100644 --- a/config/healthcheck.php +++ b/config/healthcheck.php @@ -20,6 +20,7 @@ \UKFast\HealthCheck\Checks\RedisHealthCheck::class, \UKFast\HealthCheck\Checks\SchedulerHealthCheck::class, \UKFast\HealthCheck\Checks\StorageHealthCheck::class, + \App\HorizonHealthCheck::class, ], /**