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'],
*
* @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');
$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) {