summaryrefslogtreecommitdiffstats
path: root/lib/private/Files/Config
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2022-03-10 15:53:39 +0100
committerRobin Appelman <robin@icewind.nl>2022-03-24 17:01:55 +0100
commit506d29c095e0ff880605bd8e521572ed60c98438 (patch)
treecc67f8d10595919b972fb4d4423c394bc3466368 /lib/private/Files/Config
parenta617e1e7115d7ccc01ab846981b17bee828cbcec (diff)
downloadnextcloud-server-506d29c095e0ff880605bd8e521572ed60c98438.tar.gz
nextcloud-server-506d29c095e0ff880605bd8e521572ed60c98438.zip
update cached mounts when only specific providers have been setup
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/Files/Config')
-rw-r--r--lib/private/Files/Config/UserMountCache.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/private/Files/Config/UserMountCache.php b/lib/private/Files/Config/UserMountCache.php
index e5c2baa2735..6537d07393e 100644
--- a/lib/private/Files/Config/UserMountCache.php
+++ b/lib/private/Files/Config/UserMountCache.php
@@ -89,7 +89,7 @@ class UserMountCache implements IUserMountCache {
$this->mountsForUsers = new CappedMemoryCache();
}
- public function registerMounts(IUser $user, array $mounts) {
+ public function registerMounts(IUser $user, array $mounts, array $mountProviderClasses = null) {
// filter out non-proper storages coming from unit tests
$mounts = array_filter($mounts, function (IMountPoint $mount) {
return $mount instanceof SharedMount || $mount->getStorage() && $mount->getStorage()->getCache();
@@ -110,6 +110,11 @@ class UserMountCache implements IUserMountCache {
$newMounts = array_combine($newMountRootIds, $newMounts);
$cachedMounts = $this->getMountsForUser($user);
+ if (is_array($mountProviderClasses)) {
+ $cachedMounts = array_filter($cachedMounts, function (ICachedMountInfo $mountInfo) use ($mountProviderClasses) {
+ return in_array($mountInfo->getMountProvider(), $mountProviderClasses);
+ });
+ }
$cachedMountRootIds = array_map(function (ICachedMountInfo $mount) {
return $mount->getRootId();
}, $cachedMounts);