aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2025-03-07 17:52:06 +0100
committerRobin Appelman <robin@icewind.nl>2025-03-19 16:43:58 +0100
commitcaf2279507a83de762041d96e760832a8e8ddcc5 (patch)
tree045b4aeedebde23f844a31050f11ea225da337bc /lib
parentda772b275c54ebd3edfe5c1d0a85c854e48888d7 (diff)
downloadnextcloud-server-caf2279507a83de762041d96e760832a8e8ddcc5.tar.gz
nextcloud-server-caf2279507a83de762041d96e760832a8e8ddcc5.zip
fix: skip registering mounts if there are no new mount providers
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/SetupManager.php18
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/private/Files/SetupManager.php b/lib/private/Files/SetupManager.php
index 8f4c3a3311f..51b68d06166 100644
--- a/lib/private/Files/SetupManager.php
+++ b/lib/private/Files/SetupManager.php
@@ -271,18 +271,20 @@ class SetupManager {
private function afterUserFullySetup(IUser $user, array $previouslySetupProviders): void {
$this->eventLogger->start('fs:setup:user:full:post', 'Housekeeping after user is setup');
$userRoot = '/' . $user->getUID() . '/';
- $mounts = $this->mountManager->getAll();
- $mounts = array_filter($mounts, function (IMountPoint $mount) use ($userRoot) {
- return str_starts_with($mount->getMountPoint(), $userRoot);
- });
$allProviders = array_map(function ($provider) {
return get_class($provider);
}, array_merge($this->mountProviderCollection->getProviders(), $this->mountProviderCollection->getHomeProviders()));
$newProviders = array_diff($allProviders, $previouslySetupProviders);
- $mounts = array_filter($mounts, function (IMountPoint $mount) use ($previouslySetupProviders) {
- return !in_array($mount->getMountProvider(), $previouslySetupProviders);
- });
- $this->userMountCache->registerMounts($user, $mounts, $newProviders);
+ if (count($newProviders) > 0) {
+ $mounts = $this->mountManager->getAll();
+ $mounts = array_filter($mounts, function (IMountPoint $mount) use ($userRoot, $previouslySetupProviders) {
+ if (!str_starts_with($mount->getMountPoint(), $userRoot)) {
+ return false;
+ }
+ return !in_array($mount->getMountProvider(), $previouslySetupProviders);
+ });
+ $this->userMountCache->registerMounts($user, $mounts, $newProviders);
+ }
$cacheDuration = $this->config->getSystemValueInt('fs_mount_cache_duration', 5 * 60);
if ($cacheDuration > 0) {