aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-06-15 13:02:39 +0200
committerLukas Reschke <lukas@owncloud.com>2016-06-20 17:37:38 +0200
commitac56629c867ed2498f01eb696c3b3830b19cfc96 (patch)
treeb1af1b0ff3610846955041dbf8793c373aeb3678
parent38663e13cc5a8781fb61dc45f6696127b7a54c35 (diff)
downloadnextcloud-server-ac56629c867ed2498f01eb696c3b3830b19cfc96.tar.gz
nextcloud-server-ac56629c867ed2498f01eb696c3b3830b19cfc96.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) {