Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-11-25 13:04:01 +0300
committerGitHub <noreply@github.com>2016-11-25 13:04:01 +0300
commit9a2ab513a983f31580d5c1061436a2041931ccdf (patch)
tree85966b557511e98530ff8995af6d205da2d20144 /lib
parentfc7abeb05d9ea63b0cd7dfb8e6a6e0c4c6f15aa3 (diff)
parenteca5ff31fb10c2469a8c4cebf62f9993d2fed621 (diff)
Merge pull request #26699 from owncloud/stable9-occ-filesscan-skipshares
[stable9] Skip local shares in bkg scan and occ files:scan (#26590)
Diffstat (limited to 'lib')
-rw-r--r--lib/private/files/utils/scanner.php21
1 files changed, 16 insertions, 5 deletions
diff --git a/lib/private/files/utils/scanner.php b/lib/private/files/utils/scanner.php
index cf85ff4c997..e3ef5036bd8 100644
--- a/lib/private/files/utils/scanner.php
+++ b/lib/private/files/utils/scanner.php
@@ -117,14 +117,20 @@ class Scanner extends PublicEmitter {
public function backgroundScan($dir) {
$mounts = $this->getMounts($dir);
foreach ($mounts as $mount) {
- if (is_null($mount->getStorage())) {
+ $storage = $mount->getStorage();
+ if (is_null($storage)) {
continue;
}
// don't scan the root storage
- if ($mount->getStorage()->instanceOfStorage('\OC\Files\Storage\Local') && $mount->getMountPoint() === '/') {
+ if ($storage->instanceOfStorage('\OC\Files\Storage\Local') && $mount->getMountPoint() === '/') {
continue;
}
- $scanner = $mount->getStorage()->getScanner();
+
+ // don't scan received local shares, these can be scanned when scanning the owner's storage
+ if ($storage->instanceOfStorage('OCA\Files_Sharing\ISharedStorage')) {
+ continue;
+ }
+ $scanner = $storage->getScanner();
$this->attachListener($mount);
$scanner->backgroundScan();
}
@@ -140,10 +146,10 @@ class Scanner extends PublicEmitter {
}
$mounts = $this->getMounts($dir);
foreach ($mounts as $mount) {
- if (is_null($mount->getStorage())) {
+ $storage = $mount->getStorage();
+ if (is_null($storage)) {
continue;
}
- $storage = $mount->getStorage();
// if the home storage isn't writable then the scanner is run as the wrong user
if ($storage->instanceOfStorage('\OC\Files\Storage\Home') and
(!$storage->isCreatable('') or !$storage->isCreatable('files'))
@@ -155,6 +161,11 @@ class Scanner extends PublicEmitter {
}
}
+
+ // don't scan received local shares, these can be scanned when scanning the owner's storage
+ if ($storage->instanceOfStorage('OCA\Files_Sharing\ISharedStorage')) {
+ continue;
+ }
$relativePath = $mount->getInternalPath($dir);
$scanner = $storage->getScanner();
$scanner->setUseTransactions(false);