Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/env/PhabricatorEnv.php
Show First 20 Lines • Show All 243 Lines • ▼ Show 20 Lines | if (!$masters) { | ||||
if ($master->isSevered()) { | if ($master->isSevered()) { | ||||
self::setReadOnly(true, self::READONLY_SEVERED); | self::setReadOnly(true, self::READONLY_SEVERED); | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
try { | try { | ||||
$stack->pushSource( | // See T13403. If we're starting up in "config optional" mode, suppress | ||||
id(new PhabricatorConfigDatabaseSource('default')) | // messages about connection retries. | ||||
->setName(pht('Database'))); | if ($config_optional) { | ||||
$database_source = @new PhabricatorConfigDatabaseSource('default'); | |||||
} else { | |||||
$database_source = new PhabricatorConfigDatabaseSource('default'); | |||||
} | |||||
$database_source->setName(pht('Database')); | |||||
$stack->pushSource($database_source); | |||||
} catch (AphrontSchemaQueryException $exception) { | } catch (AphrontSchemaQueryException $exception) { | ||||
// If the database is not available, just skip this configuration | // If the database is not available, just skip this configuration | ||||
// source. This happens during `bin/storage upgrade`, `bin/conf` before | // source. This happens during `bin/storage upgrade`, `bin/conf` before | ||||
// schema setup, etc. | // schema setup, etc. | ||||
} catch (PhabricatorClusterStrandedException $ex) { | } catch (PhabricatorClusterStrandedException $ex) { | ||||
// This means we can't connect to any database host. That's fine as | // This means we can't connect to any database host. That's fine as | ||||
// long as we're running a setup script like `bin/storage`. | // long as we're running a setup script like `bin/storage`. | ||||
if (!$config_optional) { | if (!$config_optional) { | ||||
▲ Show 20 Lines • Show All 715 Lines • Show Last 20 Lines |