mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Merge pull request #35308 from nextcloud/bugfix/34961/user-mgmt-quota-no-cache
Don't use quota cache through user management
This commit is contained in:
commit
09345f762b
2 changed files with 9 additions and 5 deletions
|
|
@ -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'],
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue