Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/storage/lisk/PhabricatorLiskDAO.php
Show First 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | protected function establishLiveConnection($mode) { | ||||
if ($is_readonly) { | if ($is_readonly) { | ||||
$connection->setReadOnly(true); | $connection->setReadOnly(true); | ||||
} | } | ||||
// Unless this is a script running from the CLI: | // Unless this is a script running from the CLI: | ||||
// - (T10849) Prevent any query from running for more than 30 seconds. | // - (T10849) Prevent any query from running for more than 30 seconds. | ||||
// - (T11672) Use persistent connections. | // - (T11672) Use persistent connections. | ||||
if (php_sapi_name() != 'cli') { | if (php_sapi_name() != 'cli') { | ||||
// TODO: For now, disable this until after T11044: it's better at high | |||||
Lint: TODO Comment: This comment has a TODO. | |||||
// load, but causes us to use slightly more connections at low load and | |||||
// is pushing users over limits like MySQL "max_connections". | |||||
$use_persistent = false; | |||||
$connection | $connection | ||||
->setQueryTimeout(30) | ->setQueryTimeout(30) | ||||
->setPersistent(true); | ->setPersistent($use_persistent); | ||||
} | } | ||||
return $connection; | return $connection; | ||||
} | } | ||||
private function newBasicConnection($database, $mode, $namespace) { | private function newBasicConnection($database, $mode, $namespace) { | ||||
$conf = PhabricatorEnv::newObjectFromConfig( | $conf = PhabricatorEnv::newObjectFromConfig( | ||||
'mysql.configuration-provider', | 'mysql.configuration-provider', | ||||
▲ Show 20 Lines • Show All 256 Lines • Show Last 20 Lines |
This comment has a TODO.