diff options
author | Robin Appelman <robin@icewind.nl> | 2018-06-25 13:01:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-25 13:01:22 +0200 |
commit | 587d7cc7d217e2204fd677dcc787e61a6ba0a381 (patch) | |
tree | d11c16cbe6f98cee7f64fddf7f4c16b50e728379 /lib/private/Files | |
parent | a431cc3b58dc5ab2c4c1b47be2e11a35f850631e (diff) | |
parent | 4a3471595aec40aca825339a2446d9f9dd8ab963 (diff) | |
download | nextcloud-server-587d7cc7d217e2204fd677dcc787e61a6ba0a381.tar.gz nextcloud-server-587d7cc7d217e2204fd677dcc787e61a6ba0a381.zip |
Merge pull request #9526 from Blaok/files-scan-shallow
allow shallow (non-recursive) scan when scanning file storage
Diffstat (limited to 'lib/private/Files')
-rw-r--r-- | lib/private/Files/Utils/Scanner.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/Files/Utils/Scanner.php b/lib/private/Files/Utils/Scanner.php index dd20e11fb63..f91696e77bb 100644 --- a/lib/private/Files/Utils/Scanner.php +++ b/lib/private/Files/Utils/Scanner.php @@ -185,7 +185,7 @@ class Scanner extends PublicEmitter { * @throws \OC\ForbiddenException * @throws \OCP\Files\NotFoundException */ - public function scan($dir = '') { + public function scan($dir = '', $recursive = \OC\Files\Cache\Scanner::SCAN_RECURSIVE) { if (!Filesystem::isValidPath($dir)) { throw new \InvalidArgumentException('Invalid path to scan'); } @@ -242,7 +242,7 @@ class Scanner extends PublicEmitter { try { $propagator = $storage->getPropagator(); $propagator->beginBatch(); - $scanner->scan($relativePath, \OC\Files\Cache\Scanner::SCAN_RECURSIVE, \OC\Files\Cache\Scanner::REUSE_ETAG | \OC\Files\Cache\Scanner::REUSE_SIZE); + $scanner->scan($relativePath, $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 |