Differential D17601 Diff 42341 src/applications/config/check/PhabricatorElasticsearchSetupCheck.php.lowercase
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/config/check/PhabricatorElasticsearchSetupCheck.php.lowercase
- This file was moved from src/applications/config/check/PhabricatorElasticSearchSetupCheck.php.
<?php | <?php | ||||
final class PhabricatorElasticSearchSetupCheck extends PhabricatorSetupCheck { | final class PhabricatorElasticsearchSetupCheck extends PhabricatorSetupCheck { | ||||
public function getDefaultGroup() { | public function getDefaultGroup() { | ||||
return self::GROUP_OTHER; | return self::GROUP_OTHER; | ||||
} | } | ||||
protected function executeChecks() { | protected function executeChecks() { | ||||
$services = PhabricatorSearchService::getAllServices(); | $services = PhabricatorSearchService::getAllServices(); | ||||
foreach ($services as $service) { | foreach ($services as $service) { | ||||
try { | try { | ||||
$host = $service->getAnyHostForRole('read'); | $host = $service->getAnyHostForRole('read'); | ||||
} catch (PhabricatorClusterNoHostForRoleException $e) { | } catch (PhabricatorClusterNoHostForRoleException $e) { | ||||
// ignore the error | // ignore the error | ||||
continue; | continue; | ||||
} | } | ||||
if ($host instanceof PhabricatorElasticSearchHost) { | if ($host instanceof PhabricatorElasticsearchHost) { | ||||
$index_exists = null; | $index_exists = null; | ||||
$index_sane = null; | $index_sane = null; | ||||
try { | try { | ||||
$engine = $host->getEngine(); | $engine = $host->getEngine(); | ||||
$index_exists = $engine->indexExists(); | $index_exists = $engine->indexExists(); | ||||
if ($index_exists) { | if ($index_exists) { | ||||
$index_sane = $engine->indexIsSane(); | $index_sane = $engine->indexIsSane(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 55 Lines • Show Last 20 Lines |