diff options
author | blizzz <blizzz@arthur-schiwon.de> | 2022-04-22 15:46:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-22 15:46:09 +0200 |
commit | 98a260940fe1f3a4d7445fe8e2fd723c4d914a2f (patch) | |
tree | 091deda99f0bf026050c218b1f2cc50b2717e3c0 /lib/private | |
parent | efde83e07f3d5474326334008755cba4b13fa6ee (diff) | |
parent | f7a0157589d67dcfcd3e950c36f3a65e82c784b0 (diff) | |
download | nextcloud-server-98a260940fe1f3a4d7445fe8e2fd723c4d914a2f.tar.gz nextcloud-server-98a260940fe1f3a4d7445fe8e2fd723c4d914a2f.zip |
Merge pull request #32066 from nextcloud/backport/32045/stable24
[stable24] cache fullSetupRequired locally
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Files/SetupManager.php | 8 |
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()); |