Browse Source

trigger size calculation after scanning (#24875)

tags/v9.0.1beta2
Robin Appelman 8 years ago
parent
commit
d717b583d2
1 changed files with 6 additions and 0 deletions
  1. 6
    0
      lib/private/Files/Utils/Scanner.php

+ 6
- 0
lib/private/Files/Utils/Scanner.php View File

@@ -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);

Loading…
Cancel
Save