Replies: 1 comment
-
I make the following code to resolve my problem: <?php
class RunHealthCheckSchedule extends RunHealthChecksCommand
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'health:schedule {--do-not-store-results} {--no-notification} {--fail-command-on-failing-check}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Run schedule health check';
/** @return Collection<int, Result> */
protected function runChecks(): Collection
{
return app(Health::class)
->registeredChecks()
->filter(fn (Check $check) => $check instanceof ScheduleCheck)
->map(function (Check $check): Result {
return $check->shouldRun()
? $this->runCheck($check)
: (new Result(Status::skipped()))->check($check)->endedAt(now());
});
}
} But i think some native solution on the package is the best way. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I'm migrating my application to docker, and I'm configuring a project so that each container runs only one application, so that the web application runs in one container, the scheduler runs in another, and the workers in another.
I was thinking about adding the laravel-health package to be able to monitor the health of each of the containers, but there is no way for me to check only one type of health for each container.
I think it would be ideal to add an optional option to the health:check command which could check only one type of health, and that would allow restarting only one container if only one service was out instead of restarting all.
Beta Was this translation helpful? Give feedback.
All reactions