diff --git a/lib/private/Memcache/Factory.php b/lib/private/Memcache/Factory.php index 33deeea4e2b..23e0550f62e 100644 --- a/lib/private/Memcache/Factory.php +++ b/lib/private/Memcache/Factory.php @@ -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());