diff --git a/Classes/Connection.php b/Classes/Connection.php index 5525f677..61a1171a 100644 --- a/Classes/Connection.php +++ b/Classes/Connection.php @@ -30,10 +30,8 @@ public static function getClient() { if (self::$client == null) { self::$client = ClientBuilder::create() - ->setHosts( - ExtconfService::getInstance() - ->getHostsSettings() - )->build(); + ->setHosts(ExtconfService::getInstance()->getHostsSettings()) + ->build(); } return self::$client; } @@ -46,6 +44,7 @@ public static function getClient() public static function isHealthy() { $ping = self::getClient()->ping(); + return $ping; } } diff --git a/Classes/Service/IndexingService.php b/Classes/Service/IndexingService.php index a3219d0d..09b57454 100644 --- a/Classes/Service/IndexingService.php +++ b/Classes/Service/IndexingService.php @@ -309,7 +309,9 @@ protected function applyEnvironment(array $environment): array protected function assertConnectionHealthy(): void { if (!Connection::isHealthy()) { - throw new \RuntimeException('Elasticsearch is offline', 1599662577); + $hosts = ExtconfService::getInstance()->getHostsSettings(); + + throw new \RuntimeException(sprintf('Elasticsearch at "%s" is offline', implode(', ', $hosts)), 1599662577); } }