diff options
author | Simon L <szaimen@e.mail.de> | 2022-11-21 18:39:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-21 18:39:31 +0100 |
commit | 09345f762b67384ac03c7ea28a6d3e575aaec83b (patch) | |
tree | d7efe84d8c22a12b0b51a50e3fb8da70cb84254d | |
parent | 83badcba82fbb8ee438708b9da115ac1eea60db9 (diff) | |
parent | 0b09531dc66f6a82fd1db997ceff85b1407f01fa (diff) | |
download | nextcloud-server-09345f762b67384ac03c7ea28a6d3e575aaec83b.tar.gz nextcloud-server-09345f762b67384ac03c7ea28a6d3e575aaec83b.zip |
Merge pull request #35308 from nextcloud/bugfix/34961/user-mgmt-quota-no-cache
Don't use quota cache through user management
-rw-r--r-- | apps/provisioning_api/lib/Controller/AUserData.php | 2 | ||||
-rw-r--r-- | lib/private/legacy/OC_Helper.php | 12 |
2 files changed, 9 insertions, 5 deletions
diff --git a/apps/provisioning_api/lib/Controller/AUserData.php b/apps/provisioning_api/lib/Controller/AUserData.php index f2fbea7b04f..0fc2bb6f0d3 100644 --- a/apps/provisioning_api/lib/Controller/AUserData.php +++ b/apps/provisioning_api/lib/Controller/AUserData.php @@ -245,7 +245,7 @@ abstract class AUserData extends OCSController { try { \OC_Util::tearDownFS(); \OC_Util::setupFS($userId); - $storage = OC_Helper::getStorageInfo('/'); + $storage = OC_Helper::getStorageInfo('/', null, true, false); $data = [ 'free' => $storage['free'], 'used' => $storage['used'], diff --git a/lib/private/legacy/OC_Helper.php b/lib/private/legacy/OC_Helper.php index b793029e1f1..3b409fd1d04 100644 --- a/lib/private/legacy/OC_Helper.php +++ b/lib/private/legacy/OC_Helper.php @@ -457,10 +457,12 @@ class OC_Helper { * * @param string $path * @param \OCP\Files\FileInfo $rootInfo (optional) + * @param bool $includeMountPoints whether to include mount points in the size calculation + * @param bool $useCache whether to use the cached quota values * @return array * @throws \OCP\Files\NotFoundException */ - public static function getStorageInfo($path, $rootInfo = null, $includeMountPoints = true) { + public static function getStorageInfo($path, $rootInfo = null, $includeMountPoints = true, $useCache = true) { /** @var ICacheFactory $cacheFactory */ $cacheFactory = \OC::$server->get(ICacheFactory::class); $memcache = $cacheFactory->createLocal('storage_info'); @@ -470,9 +472,11 @@ class OC_Helper { $fullPath = Filesystem::getView()->getAbsolutePath($path); $cacheKey = $fullPath. '::' . ($includeMountPoints ? 'include' : 'exclude'); - $cached = $memcache->get($cacheKey); - if ($cached) { - return $cached; + if ($useCache) { + $cached = $memcache->get($cacheKey); + if ($cached) { + return $cached; + } } if (!$rootInfo) { |