| 1 | <?php |
||
| 13 | class HorizonIsRunning implements Check |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * @var \Laravel\Horizon\Contracts\MasterSupervisorRepository |
||
| 17 | */ |
||
| 18 | private $supervisorRepository; |
||
| 19 | |||
| 20 | public function __construct(MasterSupervisorRepository $supervisorRepository) |
||
| 24 | |||
| 25 | public function name(array $config): string |
||
| 29 | |||
| 30 | public function check(array $config): bool |
||
| 31 | { |
||
| 32 | $masters = $this->supervisorRepository->all(); |
||
| 33 | if (! $masters) { |
||
| 34 | return false; |
||
| 35 | } |
||
| 36 | |||
| 37 | return ! collect($masters)->contains(static function ($master) { |
||
| 38 | return $master->status === 'paused'; |
||
| 39 | }); |
||
| 40 | } |
||
| 41 | |||
| 42 | public function message(array $config): string |
||
| 46 | } |
||
| 47 |