summaryrefslogtreecommitdiffstats
path: root/lib/private/legacy
diff options
context:
space:
mode:
authorVincent Petry <vincent@nextcloud.com>2022-11-21 16:21:25 +0100
committerVincent Petry <vincent@nextcloud.com>2022-11-21 23:46:02 +0100
commit5ed992588350c1f1dbe636dfe15baa780559b3dd (patch)
treed052d6769955e4153eee36bb714123debf249dbe /lib/private/legacy
parent0467731daed032d205e120e0195deca81de9009f (diff)
downloadnextcloud-server-5ed992588350c1f1dbe636dfe15baa780559b3dd.tar.gz
nextcloud-server-5ed992588350c1f1dbe636dfe15baa780559b3dd.zip
Don't use quota cache through user management
When querying the free space through user management APIs, don't use the cached quota value. The latter is only there to accelerate PROPFINDs. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Diffstat (limited to 'lib/private/legacy')
-rw-r--r--lib/private/legacy/OC_Helper.php12
1 files changed, 8 insertions, 4 deletions
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) {