Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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),
]);
}

Expand Down
5 changes: 4 additions & 1 deletion bootstrap/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -36,7 +37,9 @@
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();
$schedule->command(ScheduleCheckHeartbeatCommand::class)->hourly();
})
->withMiddleware(function (Middleware $middleware): void {
// CORS is applied per project by ApplyProjectCors, the post size check
Expand Down
Loading