diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2022-05-13 08:27:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-13 08:27:28 +0200 |
commit | fe33e9c08cbbc80738660d2d78838f04d24e0e2e (patch) | |
tree | feab7d407620addc9a7eb50f8bd5789e08434074 /lib/private/Files/Config/UserMountCache.php | |
parent | 48bb547e8a24dab04bcc18df9bf5f50aa6b7462a (diff) | |
parent | ec6b83cc1891214c7fa3a236626807b4335f9a2f (diff) | |
download | nextcloud-server-fe33e9c08cbbc80738660d2d78838f04d24e0e2e.tar.gz nextcloud-server-fe33e9c08cbbc80738660d2d78838f04d24e0e2e.zip |
Merge pull request #32250 from nextcloud/cleanup/cappedmemorycache
Diffstat (limited to 'lib/private/Files/Config/UserMountCache.php')
-rw-r--r-- | lib/private/Files/Config/UserMountCache.php | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/lib/private/Files/Config/UserMountCache.php b/lib/private/Files/Config/UserMountCache.php index a5fe04c2cac..c326eeb0b6c 100644 --- a/lib/private/Files/Config/UserMountCache.php +++ b/lib/private/Files/Config/UserMountCache.php @@ -36,7 +36,6 @@ use OCP\Files\Config\ICachedMountInfo; use OCP\Files\Config\IUserMountCache; use OCP\Files\Mount\IMountPoint; use OCP\Files\NotFoundException; -use OCP\ICache; use OCP\IDBConnection; use OCP\IUser; use OCP\IUserManager; @@ -46,30 +45,17 @@ use Psr\Log\LoggerInterface; * Cache mounts points per user in the cache so we can easilly look them up */ class UserMountCache implements IUserMountCache { - /** - * @var IDBConnection - */ - private $connection; - - /** - * @var IUserManager - */ - private $userManager; + private IDBConnection $connection; + private IUserManager $userManager; /** * Cached mount info. - * Map of $userId to ICachedMountInfo. - * - * @var ICache + * @var CappedMemoryCache<ICachedMountInfo[]> **/ - private $mountsForUsers; - + private CappedMemoryCache $mountsForUsers; private LoggerInterface $logger; - - /** - * @var ICache - */ - private $cacheInfoCache; + /** @var CappedMemoryCache<array> */ + private CappedMemoryCache $cacheInfoCache; /** * UserMountCache constructor. @@ -132,6 +118,7 @@ class UserMountCache implements IUserMountCache { foreach ($addedMounts as $mount) { $this->addToCache($mount); + /** @psalm-suppress InvalidArgument */ $this->mountsForUsers[$user->getUID()][] = $mount; } foreach ($removedMounts as $mount) { |