From 64c0ba0269e2dfcd77edafa60cc1b21905d99e4f Mon Sep 17 00:00:00 2001 From: "Sebastian BURGIN-FIX (ext)" Date: Fri, 23 Oct 2026 07:51:29 +0200 Subject: [PATCH 1/2] chore: run health checks and scheduler heartbeat hourly Laravel Cloud wakes a hibernating app for every task in `schedule:list` and keeps it up for the 5-minute sleep timeout, so an every-minute heartbeat or a five-minute health:check kept the app awake around the clock. Run both hourly to match the 60-minute wake-up policy; ScheduleCheck already tolerates a 120-minute-old heartbeat and Oh Dear reads fresh results on its hourly application health check. Co-Authored-By: Claude Opus 5.5 --- bootstrap/app.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bootstrap/app.php b/bootstrap/app.php index 9e3a00d..e01a3ba 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -36,7 +36,8 @@ apiPrefix: '', ) ->withSchedule(function (Schedule $schedule): void { - $schedule->command(RunHealthChecksCommand::class)->everyFiveMinutes(); + // Hourly, to match Laravel Cloud's 60-minute wake-up: Cloud wakes the app for every due task, so anything more frequent keeps it from hibernating. + $schedule->command(RunHealthChecksCommand::class)->hourly(); }) ->withMiddleware(function (Middleware $middleware): void { // CORS is applied per project by ApplyProjectCors, the post size check From 6f9203ee818196620785c7c3c497210d3a7122c3 Mon Sep 17 00:00:00 2001 From: "Sebastian BURGIN-FIX (ext)" Date: Fri, 23 Oct 2026 08:19:10 +0200 Subject: [PATCH 2/2] chore: add the hourly scheduler heartbeat and ScheduleCheck All Cloud apps now run the same pair hourly, matching the 60-minute Laravel Cloud wake-up: health:check refreshes the Spatie results and the heartbeat feeds the ScheduleCheck that Oh Dear reads through the application health check. Co-Authored-By: Claude Opus 5.5 --- app/Providers/AppServiceProvider.php | 2 ++ bootstrap/app.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index bd0b3f9..1de5ac1 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -15,6 +15,7 @@ use Spatie\Health\Checks\Checks\DatabaseCheck; use Spatie\Health\Checks\Checks\DebugModeCheck; use Spatie\Health\Checks\Checks\EnvironmentCheck; +use Spatie\Health\Checks\Checks\ScheduleCheck; use Spatie\Health\Facades\Health; use Spatie\SecurityAdvisoriesHealthCheck\SecurityAdvisoriesCheck; @@ -40,6 +41,7 @@ private function configureHealthChecks(): void EnvironmentCheck::new()->if($this->app->isProduction()), SecurityAdvisoriesCheck::new()->lastDayOfMonth(), NightwatchIssuesCheck::new()->if(filled(config('default.nightwatch.api_token')) && filled(config('default.nightwatch.application_id'))), + ScheduleCheck::new()->heartbeatMaxAgeInMinutes(120), ]); } diff --git a/bootstrap/app.php b/bootstrap/app.php index e01a3ba..e2e475f 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -26,6 +26,7 @@ use Illuminate\Routing\Middleware\ThrottleRequests; use Illuminate\Validation\ValidationException; use Spatie\Health\Commands\RunHealthChecksCommand; +use Spatie\Health\Commands\ScheduleCheckHeartbeatCommand; use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface; use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; @@ -38,6 +39,7 @@ ->withSchedule(function (Schedule $schedule): void { // Hourly, to match Laravel Cloud's 60-minute wake-up: Cloud wakes the app for every due task, so anything more frequent keeps it from hibernating. $schedule->command(RunHealthChecksCommand::class)->hourly(); + $schedule->command(ScheduleCheckHeartbeatCommand::class)->hourly(); }) ->withMiddleware(function (Middleware $middleware): void { // CORS is applied per project by ApplyProjectCors, the post size check