summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-06-15 13:02:39 +0200
committerVincent Petry <pvince81@owncloud.com>2016-06-15 13:02:39 +0200
commita9c98daffb0e6633b3050c1944e6d6ca652abd9f (patch)
treed6564207a01a5528fcc7ee265cbd1ad35a54e2b6
parentc5a60c3ae0a569215d7dc5fd27bd5ec8465bf0c3 (diff)
downloadnextcloud-server-a9c98daffb0e6633b3050c1944e6d6ca652abd9f.tar.gz
nextcloud-server-a9c98daffb0e6633b3050c1944e6d6ca652abd9f.zip
Capped cache for cache info in UserMountCache
-rw-r--r--lib/private/files/config/usermountcache.php17
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/private/files/config/usermountcache.php b/lib/private/files/config/usermountcache.php
index 78b19972787..76281ef62e1 100644
--- a/lib/private/files/config/usermountcache.php
+++ b/lib/private/files/config/usermountcache.php
@@ -35,6 +35,7 @@ use OCP\IDBConnection;
use OCP\ILogger;
use OCP\IUser;
use OCP\IUserManager;
+use OC\Cache\CappedMemoryCache;
/**
* Cache mounts points per user in the cache so we can easilly look them up
@@ -50,15 +51,23 @@ class UserMountCache implements IUserMountCache {
*/
private $userManager;
- /** @var ICachedMountInfo[][] [$userId => [$cachedMountInfo, ....], ...] */
- private $mountsForUsers = [];
+ /**
+ * Cached mount info.
+ * Map of $userId to ICachedMountInfo.
+ *
+ * @var ICache
+ **/
+ private $mountsForUsers;
/**
* @var ILogger
*/
private $logger;
- private $cacheInfoCache = [];
+ /**
+ * @var ICache
+ */
+ private $cacheInfoCache;
/**
* UserMountCache constructor.
@@ -71,6 +80,8 @@ class UserMountCache implements IUserMountCache {
$this->connection = $connection;
$this->userManager = $userManager;
$this->logger = $logger;
+ $this->cacheInfoCache = new CappedMemoryCache();
+ $this->mountsForUsers = new CappedMemoryCache();
}
public function registerMounts(IUser $user, array $mounts) {