1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-04 20:52:43 +01:00

(stable) Fix two cache issues (global settings; initial setup)

Summary:
  - Fixes T11995. This got moved but I missed renaming this callsite.
  - Fixes T11993. If you have valid credentials, but haven't run `storage upgrade` yet, we can hit this exception during setup. Just ignore it instead.

Test Plan:
  - Saved global settings, no more fatal.
  - Changed `storage-namespace` to junk, loaded web UI with valid database credentials.

{F2106358}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11993, T11995

Differential Revision: https://secure.phabricator.com/D17024
This commit is contained in:
epriestley 2016-12-11 07:15:32 -08:00
parent 3c511adb6f
commit 3cd0001d8b
2 changed files with 3 additions and 7 deletions

View file

@ -82,12 +82,12 @@ abstract class PhabricatorSetupCheck extends Phobject {
AphrontWriteGuard::allowDangerousUnguardedWrites(true);
}
$caught = null;
try {
$db_cache = new PhabricatorKeyValueDatabaseCache();
$db_cache->deleteKey('phabricator.setup.issue-keys');
} catch (Exception $ex) {
$caught = $ex;
// If we hit an exception here, just ignore it. In particular, this can
// happen on initial startup before the databases are initialized.
}
if ($use_scope) {
@ -95,10 +95,6 @@ abstract class PhabricatorSetupCheck extends Phobject {
} else {
AphrontWriteGuard::allowDangerousUnguardedWrites(false);
}
if ($caught) {
throw $caught;
}
}
final public static function setOpenSetupIssueKeys(

View file

@ -159,7 +159,7 @@ final class PhabricatorUserPreferencesEditor
$user_phid);
} else {
$cache = PhabricatorCaches::getMutableStructureCache();
$cache->deleteKey(PhabricatorUserPreferences::getGlobalCacheKey());
$cache->deleteKey(PhabricatorUser::getGlobalSettingsCacheKey());
PhabricatorUserCache::clearCacheForAllUsers(
PhabricatorUserPreferencesCacheType::KEY_PREFERENCES);