summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-11-02 18:04:17 +0100
committerMorris Jobke <hey@morrisjobke.de>2017-03-17 00:06:48 -0600
commitcbebfaaf2bb14f9990738a085faa25c2eca8ce0b (patch)
tree0cb732f10c6a2e60178974d7b6fd37d9596d6917 /lib
parent39afcbd49feb4ba333746762fe7c9d4701db9860 (diff)
downloadnextcloud-server-cbebfaaf2bb14f9990738a085faa25c2eca8ce0b.tar.gz
nextcloud-server-cbebfaaf2bb14f9990738a085faa25c2eca8ce0b.zip
Skip FailedStorage in background scan
The background job that scans storages must skip failed storages to avoid potential exceptions, especially when the failed storage comes from a shared storage where the source is not accessible. Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/Utils/Scanner.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/private/Files/Utils/Scanner.php b/lib/private/Files/Utils/Scanner.php
index 98e2c3c8ca2..e76f3225c3c 100644
--- a/lib/private/Files/Utils/Scanner.php
+++ b/lib/private/Files/Utils/Scanner.php
@@ -123,6 +123,12 @@ class Scanner extends PublicEmitter {
if (is_null($storage)) {
continue;
}
+
+ // don't bother scanning failed storages (shortcut for same result)
+ if ($storage->instanceOfStorage('OC\Files\Storage\FailedStorage')) {
+ continue;
+ }
+
// don't scan the root storage
if ($storage->instanceOfStorage('\OC\Files\Storage\Local') && $mount->getMountPoint() === '/') {
continue;
@@ -166,6 +172,12 @@ class Scanner extends PublicEmitter {
if (is_null($storage)) {
continue;
}
+
+ // don't bother scanning failed storages (shortcut for same result)
+ if ($storage->instanceOfStorage('OC\Files\Storage\FailedStorage')) {
+ continue;
+ }
+
// 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'))