mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
fix(Memcache): use different cache key when in maintenance mode
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
db6e71181e
commit
2cc0420cce
1 changed files with 5 additions and 1 deletions
|
|
@ -113,12 +113,16 @@ class Factory implements ICacheFactory {
|
|||
protected function getGlobalPrefix(): string {
|
||||
if ($this->globalPrefix === null) {
|
||||
$config = \OCP\Server::get(SystemConfig::class);
|
||||
$maintenanceMode = $config->getValue('maintenance', false);
|
||||
$versions = [];
|
||||
if ($config->getValue('installed', false)) {
|
||||
if ($config->getValue('installed', false) && !$maintenanceMode) {
|
||||
$appConfig = \OCP\Server::get(IAppConfig::class);
|
||||
// only get the enabled apps to clear the cache in case an app is enabled or disabled (e.g. clear routes)
|
||||
$versions = $appConfig->getAppInstalledVersions(true);
|
||||
ksort($versions);
|
||||
} else {
|
||||
// if not installed or in maintenance mode, we should distinguish between both states.
|
||||
$versions['core:maintenance'] = $maintenanceMode ? '1' : '0';
|
||||
}
|
||||
$versions['core'] = implode('.', $this->serverVersion->getVersion());
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue