diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-06-10 13:06:45 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2016-06-13 15:08:12 +0200 |
commit | 86d7241be206ec00d793f35a737d24bba3295ab3 (patch) | |
tree | 1c7d53478dc6a2888aa9e2dd4419b22c52b83e53 /lib/private | |
parent | c14198b874e147c635d8f47da285dda8c99fdbb2 (diff) | |
download | nextcloud-server-86d7241be206ec00d793f35a737d24bba3295ab3.tar.gz nextcloud-server-86d7241be206ec00d793f35a737d24bba3295ab3.zip |
Capped cache for cache info in UserMountCache
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Files/Config/UserMountCache.php | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/private/Files/Config/UserMountCache.php b/lib/private/Files/Config/UserMountCache.php index edb1525b276..9b11fddc858 100644 --- a/lib/private/Files/Config/UserMountCache.php +++ b/lib/private/Files/Config/UserMountCache.php @@ -36,6 +36,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 @@ -51,15 +52,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. @@ -72,6 +81,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) { |