diff options
author | Robin Appelman <robin@icewind.nl> | 2016-05-30 12:14:31 +0300 |
---|---|---|
committer | Thomas Müller <DeepDiver1975@users.noreply.github.com> | 2016-05-30 12:14:31 +0300 |
commit | d717b583d22c66c08563e35b9b770a8b18954087 (patch) | |
tree | ea2c5a5786b8d717763e63cbc452101aad442070 | |
parent | 985063a7e2307ba645e4912c147ac381fa7b6974 (diff) |
trigger size calculation after scanning (#24875)
-rw-r--r-- | lib/private/Files/Utils/Scanner.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/private/Files/Utils/Scanner.php b/lib/private/Files/Utils/Scanner.php index 470b12bb44a..9b55c312e26 100644 --- a/lib/private/Files/Utils/Scanner.php +++ b/lib/private/Files/Utils/Scanner.php @@ -25,6 +25,7 @@ namespace OC\Files\Utils; +use OC\Files\Cache\Cache; use OC\Files\Filesystem; use OC\ForbiddenException; use OC\Hooks\PublicEmitter; @@ -182,6 +183,11 @@ class Scanner extends PublicEmitter { } try { $scanner->scan($relativePath, \OC\Files\Cache\Scanner::SCAN_RECURSIVE, \OC\Files\Cache\Scanner::REUSE_ETAG | \OC\Files\Cache\Scanner::REUSE_SIZE); + $cache = $storage->getCache(); + if ($cache instanceof Cache) { + // only re-calculate for the root folder we scanned, anything below that is taken care of by the scanner + $cache->correctFolderSize($relativePath); + } } catch (StorageNotAvailableException $e) { $this->logger->error('Storage ' . $storage->getId() . ' not available'); $this->logger->logException($e); |