aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2022-04-21 15:23:09 +0200
committerRobin Appelman <robin@icewind.nl>2022-04-21 16:00:28 +0200
commitbbf283f818986b28f4c26dab1eeec0a962642aef (patch)
tree5834e51d227d4bde21e053d75380466010d5c55c /lib/private
parentcaebdc2a559f995ff5672cdea7c46a5febaa1ea5 (diff)
downloadnextcloud-server-bbf283f818986b28f4c26dab1eeec0a962642aef.tar.gz
nextcloud-server-bbf283f818986b28f4c26dab1eeec0a962642aef.zip
cache fullSetupRequired locally
no need to hit redis every time Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/Files/SetupManager.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/private/Files/SetupManager.php b/lib/private/Files/SetupManager.php
index e0575ea92a5..f1799798ccb 100644
--- a/lib/private/Files/SetupManager.php
+++ b/lib/private/Files/SetupManager.php
@@ -81,6 +81,7 @@ class SetupManager {
private LoggerInterface $logger;
private IConfig $config;
private bool $listeningForProviders;
+ private array $fullSetupRequired = [];
public function __construct(
IEventLogger $eventLogger,
@@ -268,6 +269,7 @@ class SetupManager {
$cacheDuration = $this->config->getSystemValueInt('fs_mount_cache_duration', 5 * 60);
if ($cacheDuration > 0) {
$this->cache->set($user->getUID(), true, $cacheDuration);
+ $this->fullSetupRequired[$user->getUID()] = false;
}
}
@@ -434,7 +436,10 @@ class SetupManager {
// we perform a "cached" setup only after having done the full setup recently
// this is also used to trigger a full setup after handling events that are likely
// to change the available mounts
- return !$this->cache->get($user->getUID());
+ if (!isset($this->fullSetupRequired[$user->getUID()])) {
+ $this->fullSetupRequired[$user->getUID()] = !$this->cache->get($user->getUID());
+ }
+ return $this->fullSetupRequired[$user->getUID()];
}
/**
@@ -489,6 +494,7 @@ class SetupManager {
$this->setupUsers = [];
$this->setupUsersComplete = [];
$this->setupUserMountProviders = [];
+ $this->fullSetupRequired = [];
$this->rootSetup = false;
$this->mountManager->clear();
$this->eventDispatcher->dispatchTyped(new FilesystemTornDownEvent());