From d46bccfdc0bf55e86e8896cf81355e981141ff32 Mon Sep 17 00:00:00 2001 From: kolaente Date: Wed, 3 Jul 2024 17:45:51 +0200 Subject: [PATCH] fix: do not try to send notifications when they are disabled Currently, the command will be triggered from the /health endpoint and will send a notification no matter what is configured. This PR adds a check so that it will only do that when notifications are actually enabled. --- src/Commands/RunHealthChecksCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Commands/RunHealthChecksCommand.php b/src/Commands/RunHealthChecksCommand.php index e6f3866c..c6aa8e79 100644 --- a/src/Commands/RunHealthChecksCommand.php +++ b/src/Commands/RunHealthChecksCommand.php @@ -29,7 +29,7 @@ public function handle(): int $results = $this->runChecks(); - if (! $this->option('no-notification')) { + if (! $this->option('no-notification') && config('health.notifications.enabled', false)) { $this->sendNotification($results); }