summaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
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);