Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/cluster/PhabricatorDatabaseRef.php
Show First 20 Lines • Show All 399 Lines • ▼ Show 20 Lines | public function isReachable(AphrontDatabaseConnection $connection) { | ||||
if ($this->isSevered() && !$should_check) { | if ($this->isSevered() && !$should_check) { | ||||
return false; | return false; | ||||
} | } | ||||
try { | try { | ||||
$connection->openConnection(); | $connection->openConnection(); | ||||
$reachable = true; | $reachable = true; | ||||
} catch (AphrontSchemaQueryException $ex) { | |||||
// We get one of these if the database we're trying to select does not | |||||
// exist. In this case, just re-throw the exception. This is expected | |||||
// during first-time setup, when databases like "config" will not exist | |||||
// yet. | |||||
throw $ex; | |||||
} catch (Exception $ex) { | } catch (Exception $ex) { | ||||
$reachable = false; | $reachable = false; | ||||
} | } | ||||
if ($should_check) { | if ($should_check) { | ||||
$record->didHealthCheck($reachable); | $record->didHealthCheck($reachable); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 117 Lines • Show Last 20 Lines |