From fcfe0f8272ce62650384e534922f0f58679616ea Mon Sep 17 00:00:00 2001 From: "Siwat T." Date: Wed, 25 Dec 2024 19:43:40 +0700 Subject: [PATCH] fix: remove custom health check route --- .../SimpleHealthCheckController.php | 30 ------------------- routes/web.php | 3 +- 2 files changed, 2 insertions(+), 31 deletions(-) delete mode 100644 app/Http/Controllers/SimpleHealthCheckController.php diff --git a/app/Http/Controllers/SimpleHealthCheckController.php b/app/Http/Controllers/SimpleHealthCheckController.php deleted file mode 100644 index efe0943..0000000 --- a/app/Http/Controllers/SimpleHealthCheckController.php +++ /dev/null @@ -1,30 +0,0 @@ -has('fresh') || config('health.oh_dear_endpoint.always_send_fresh_results')) { - Artisan::call(RunHealthChecksCommand::class); - } - - // Modified behavior: check only for failed checks but not warning checks - if (!($resultStore->latestResults()?->containsCheckWithStatus(Status::failed()))) { - throw new ServiceUnavailableHttpException(message: 'Application not healthy'); - } - - return response([ - 'healthy' => true, - ]) - ->header('Content-Type', 'application/json') - ->header('Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0'); - } -} diff --git a/routes/web.php b/routes/web.php index ecdff23..8323451 100644 --- a/routes/web.php +++ b/routes/web.php @@ -1,6 +1,7 @@