Skip to content

Commit 15229e0

Browse files
committed
fix(Memcache): use different cache key when in maintenance mode
Signed-off-by: Ferdinand Thiessen <[email protected]>
1 parent e89a8d8 commit 15229e0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/private/Memcache/Factory.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,16 @@ public function __construct(
113113
protected function getGlobalPrefix(): string {
114114
if ($this->globalPrefix === null) {
115115
$config = \OCP\Server::get(SystemConfig::class);
116+
$maintenanceMode = $config->getValue('maintenance', false);
116117
$versions = [];
117-
if ($config->getValue('installed', false)) {
118+
if ($config->getValue('installed', false) && !$maintenanceMode) {
118119
$appConfig = \OCP\Server::get(IAppConfig::class);
119120
// only get the enabled apps to clear the cache in case an app is enabled or disabled (e.g. clear routes)
120121
$versions = $appConfig->getAppInstalledVersions(true);
121122
ksort($versions);
123+
} else {
124+
// if not installed or in maintenance mode, we should distinguish between both states.
125+
$versions['core:maintenance'] = $maintenanceMode ? '1' : '0';
122126
}
123127
$versions['core'] = implode('.', $this->serverVersion->getVersion());
124128

0 commit comments

Comments
 (0)