summaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-11-27 14:02:50 +0100
committerRobin Appelman <icewind@owncloud.com>2015-11-27 14:02:50 +0100
commitae71f80f4a3262e3f12de4c71af1cc388904425d (patch)
treecded4fc50d739239a71da2c1e6b5cd1454103508 /apps/files
parent8fe878afe9af165b98470a75203df2f1b32cb68f (diff)
downloadnextcloud-server-ae71f80f4a3262e3f12de4c71af1cc388904425d.tar.gz
nextcloud-server-ae71f80f4a3262e3f12de4c71af1cc388904425d.zip
Skip unavailable storages in scanner
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/ajax/scan.php2
-rw-r--r--apps/files/command/scan.php6
2 files changed, 6 insertions, 2 deletions
diff --git a/apps/files/ajax/scan.php b/apps/files/ajax/scan.php
index 759f2d15f84..7710a28a8ca 100644
--- a/apps/files/ajax/scan.php
+++ b/apps/files/ajax/scan.php
@@ -47,7 +47,7 @@ $listener = new ScanListener($eventSource);
foreach ($users as $user) {
$eventSource->send('user', $user);
- $scanner = new \OC\Files\Utils\Scanner($user, \OC::$server->getDatabaseConnection());
+ $scanner = new \OC\Files\Utils\Scanner($user, \OC::$server->getDatabaseConnection(), \OC::$server->getLogger());
$scanner->listen('\OC\Files\Utils\Scanner', 'scanFile', array($listener, 'file'));
try {
if ($force) {
diff --git a/apps/files/command/scan.php b/apps/files/command/scan.php
index 99ce64e09cc..31ae555e041 100644
--- a/apps/files/command/scan.php
+++ b/apps/files/command/scan.php
@@ -26,6 +26,7 @@
namespace OCA\Files\Command;
use OC\ForbiddenException;
+use OCP\Files\StorageNotAvailableException;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
@@ -74,7 +75,7 @@ class Scan extends Command {
}
protected function scanFiles($user, $path, $quiet, OutputInterface $output) {
- $scanner = new \OC\Files\Utils\Scanner($user, \OC::$server->getDatabaseConnection());
+ $scanner = new \OC\Files\Utils\Scanner($user, \OC::$server->getDatabaseConnection(), \OC::$server->getLogger());
if (!$quiet) {
$scanner->listen('\OC\Files\Utils\Scanner', 'scanFile', function ($path) use ($output) {
$output->writeln("Scanning file <info>$path</info>");
@@ -82,6 +83,9 @@ class Scan extends Command {
$scanner->listen('\OC\Files\Utils\Scanner', 'scanFolder', function ($path) use ($output) {
$output->writeln("Scanning folder <info>$path</info>");
});
+ $scanner->listen('\OC\Files\Utils\Scanner', 'StorageNotAvailable', function (StorageNotAvailableException $e) use ($output) {
+ $output->writeln("Error while scanning, storage not available (" . $e->getMessage() . ")");
+ });
}
try {
$scanner->scan($path);