mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 16:52:41 +01:00
Apply a hack to unbreak bin/storage upgrade
across the DB config boundary
Summary: This is gross, but fixes an issue where `bin/storage upgrade` tries to access DB config which doesn't exist yet. We need a version of this for `bin/config` anyway. I'll sort this out into a proper sequenced startup process in a followup. Test Plan: `bin/storage upgrade` no longer fatals when upgrading across the config boundary. Reviewers: asherkin, codeblock, btrahan, vrana Reviewed By: codeblock CC: aran Differential Revision: https://secure.phabricator.com/D4512
This commit is contained in:
parent
27e2198e11
commit
0e36c802c5
1 changed files with 9 additions and 5 deletions
14
src/infrastructure/env/PhabricatorEnv.php
vendored
14
src/infrastructure/env/PhabricatorEnv.php
vendored
|
@ -152,11 +152,15 @@ final class PhabricatorEnv {
|
|||
phutil_load_library($library);
|
||||
}
|
||||
|
||||
// NOTE: This must happen after the other sources are pushed, because it
|
||||
// will draw from lower-level config to bootstrap itself.
|
||||
$stack->pushSource(
|
||||
id(new PhabricatorConfigDatabaseSource('default'))
|
||||
->setName(pht("Database")));
|
||||
try {
|
||||
$stack->pushSource(
|
||||
id(new PhabricatorConfigDatabaseSource('default'))
|
||||
->setName(pht("Database")));
|
||||
} catch (AphrontQueryException $recoverable) {
|
||||
// If the database is not available, just skip this configuration
|
||||
// source. This happens during `bin/storage upgrade`, `bin/conf` before
|
||||
// schema setup, etc.
|
||||
}
|
||||
}
|
||||
|
||||
public static function repairConfig($key, $value) {
|
||||
|
|
Loading…
Reference in a new issue