diff options
author | Robin Appelman <robin@icewind.nl> | 2015-11-27 22:57:47 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2015-11-27 22:57:47 +0100 |
commit | 4c4331982c5ca3eb3315e2154ba0564d02ca96b5 (patch) | |
tree | f454c7f5eb9444eea2a48bd6f0e01db798e784a8 /apps/files | |
parent | 99c28a6ce64075be0bda93b4d46759b18b06aca6 (diff) | |
parent | 816cd66b4b88a4aa7dbee51952e30abdfacc47da (diff) | |
download | nextcloud-server-4c4331982c5ca3eb3315e2154ba0564d02ca96b5.tar.gz nextcloud-server-4c4331982c5ca3eb3315e2154ba0564d02ca96b5.zip |
Merge pull request #20789 from owncloud/scanner-skip-not-available
Skip unavailable storages in scanner
Diffstat (limited to 'apps/files')
-rw-r--r-- | apps/files/ajax/scan.php | 2 | ||||
-rw-r--r-- | apps/files/command/scan.php | 6 |
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); |