diff options
Diffstat (limited to 'apps/files_external/lib/Command')
-rw-r--r-- | apps/files_external/lib/Command/Backends.php | 2 | ||||
-rw-r--r-- | apps/files_external/lib/Command/Scan.php | 15 |
2 files changed, 15 insertions, 2 deletions
diff --git a/apps/files_external/lib/Command/Backends.php b/apps/files_external/lib/Command/Backends.php index c2d844dc781..399bdadcacf 100644 --- a/apps/files_external/lib/Command/Backends.php +++ b/apps/files_external/lib/Command/Backends.php @@ -94,7 +94,7 @@ class Backends extends Base { */ private function formatConfiguration(array $parameters): array { $configuration = array_filter($parameters, function (DefinitionParameter $parameter) { - return $parameter->getType() !== DefinitionParameter::VALUE_HIDDEN; + return $parameter->isFlagSet(DefinitionParameter::FLAG_HIDDEN); }); return array_map(function (DefinitionParameter $parameter) { return $parameter->getTypeName(); diff --git a/apps/files_external/lib/Command/Scan.php b/apps/files_external/lib/Command/Scan.php index bd54415df55..4f29dae1ce0 100644 --- a/apps/files_external/lib/Command/Scan.php +++ b/apps/files_external/lib/Command/Scan.php @@ -11,6 +11,7 @@ namespace OCA\Files_External\Command; use OC\Files\Cache\Scanner; use OCA\Files_External\Service\GlobalStoragesService; use OCP\IUserManager; +use OCP\Lock\LockedException; use Symfony\Component\Console\Helper\Table; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; @@ -82,7 +83,19 @@ class Scan extends StorageAuthBase { $this->abortIfInterrupted(); }); - $scanner->scan($path); + try { + $scanner->scan($path); + } catch (LockedException $e) { + if (is_string($e->getReadablePath()) && str_starts_with($e->getReadablePath(), 'scanner::')) { + if ($e->getReadablePath() === 'scanner::') { + $output->writeln('<error>Another process is already scanning this storage</error>'); + } else { + $output->writeln('<error>Another process is already scanning \'' . substr($e->getReadablePath(), strlen('scanner::')) . '\' in this storage</error>'); + } + } else { + throw $e; + } + } $this->presentStats($output); |