diff --git a/src/app/Console/Commands/Status/Health.php b/src/app/Console/Commands/Status/Health.php --- a/src/app/Console/Commands/Status/Health.php +++ b/src/app/Console/Commands/Status/Health.php @@ -121,11 +121,12 @@ private function checkMeet() { - try { - $urls = \config('meet.api_urls'); - foreach ($urls as $url) { - $this->line("Checking $url"); + $urls = \config('meet.api_urls'); + $success = true; + foreach ($urls as $url) { + $this->line("Checking $url"); + try { $client = new \GuzzleHttp\Client( [ 'http_errors' => false, // No exceptions from Guzzle @@ -149,15 +150,16 @@ $response = $client->request('GET', "ping"); if ($response->getStatusCode() != 200) { - $this->line("Backend not available: " . var_export($response, true)); - return false; + $this->line("Backend {$url} not available. Status: {$response->getStatusCode()} Reason: {$response->getReasonPhrase()}"); + $success = false; } + } catch (\Exception $exception) { + $this->line("Backend {$url} not available:"); + $this->line($exception); + $success = false; } - return true; - } catch (\Exception $exception) { - $this->line($exception); - return false; } + return $success; } /**