From 3287eddbbc4465ee5fcb39016b3ad0ad27959ea6 Mon Sep 17 00:00:00 2001 From: Julius Härtl Date: Thu, 16 Feb 2023 08:43:14 +0100 Subject: fix: Recalculate storage statistics on updating the quota MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/private/User/User.php | 1 + lib/private/legacy/OC_Helper.php | 9 +++++++++ 2 files changed, 10 insertions(+) (limited to 'lib') diff --git a/lib/private/User/User.php b/lib/private/User/User.php index 2b975c290ba..2d80dbc7adf 100644 --- a/lib/private/User/User.php +++ b/lib/private/User/User.php @@ -529,6 +529,7 @@ class User implements IUser { $this->config->setUserValue($this->uid, 'files', 'quota', $quota); $this->triggerChange('quota', $quota, $oldQuota); } + \OC_Helper::clearStorageInfo('/' . $this->uid . '/files'); } /** diff --git a/lib/private/legacy/OC_Helper.php b/lib/private/legacy/OC_Helper.php index c2036c7b863..0004edf5b8f 100644 --- a/lib/private/legacy/OC_Helper.php +++ b/lib/private/legacy/OC_Helper.php @@ -620,6 +620,15 @@ class OC_Helper { ]; } + public static function clearStorageInfo(string $absolutePath): void { + /** @var ICacheFactory $cacheFactory */ + $cacheFactory = \OC::$server->get(ICacheFactory::class); + $memcache = $cacheFactory->createLocal('storage_info'); + $cacheKey = Filesystem::normalizePath($absolutePath) . '::'; + $memcache->remove($cacheKey . 'include'); + $memcache->remove($cacheKey . 'exclude'); + } + /** * Returns whether the config file is set manually to read-only * @return bool -- cgit v1.2.3