From cbebfaaf2bb14f9990738a085faa25c2eca8ce0b Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Wed, 2 Nov 2016 18:04:17 +0100 Subject: 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 --- lib/private/Files/Utils/Scanner.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib') 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')) -- cgit v1.2.3