diff --git a/apps/files/lib/Command/Scan.php b/apps/files/lib/Command/Scan.php index 9d0dc266c5..a50d9abfc3 100644 --- a/apps/files/lib/Command/Scan.php +++ b/apps/files/lib/Command/Scan.php @@ -129,12 +129,12 @@ class Scan extends Base { $scanner->listen('\OC\Files\Utils\Scanner', 'scanFile', function ($path) use ($output) { $output->writeln("\tFile $path"); $this->filesCounter += 1; - $this->hasBeenInterrupted(); + $this->abortIfInterrupted(); }); $scanner->listen('\OC\Files\Utils\Scanner', 'scanFolder', function ($path) use ($output) { $output->writeln("\tFolder $path"); $this->foldersCounter += 1; - $this->hasBeenInterrupted(); + $this->abortIfInterrupted(); }); $scanner->listen('\OC\Files\Utils\Scanner', 'StorageNotAvailable', function (StorageNotAvailableException $e) use ($output) { $output->writeln('Error while scanning, storage not available (' . $e->getMessage() . ')'); @@ -143,11 +143,11 @@ class Scan extends Base { } else { $scanner->listen('\OC\Files\Utils\Scanner', 'scanFile', function () use ($output) { $this->filesCounter += 1; - $this->hasBeenInterrupted(); + $this->abortIfInterrupted(); }); $scanner->listen('\OC\Files\Utils\Scanner', 'scanFolder', function () use ($output) { $this->foldersCounter += 1; - $this->hasBeenInterrupted(); + $this->abortIfInterrupted(); }); } $scanner->listen('\OC\Files\Utils\Scanner', 'scanFile', function ($path) use ($output) { @@ -244,7 +244,7 @@ class Scan extends Base { } try { - $this->hasBeenInterrupted(); + $this->abortIfInterrupted(); } catch(InterruptedException $e) { break; } diff --git a/apps/files/lib/Command/ScanAppData.php b/apps/files/lib/Command/ScanAppData.php index 24944dad64..988bcd1e62 100644 --- a/apps/files/lib/Command/ScanAppData.php +++ b/apps/files/lib/Command/ScanAppData.php @@ -102,12 +102,12 @@ class ScanAppData extends Base { $scanner->listen('\OC\Files\Utils\Scanner', 'scanFile', function ($path) use ($output) { $output->writeln("\tFile $path"); $this->filesCounter += 1; - $this->hasBeenInterrupted(); + $this->abortIfInterrupted(); }); $scanner->listen('\OC\Files\Utils\Scanner', 'scanFolder', function ($path) use ($output) { $output->writeln("\tFolder $path"); $this->foldersCounter += 1; - $this->hasBeenInterrupted(); + $this->abortIfInterrupted(); }); $scanner->listen('\OC\Files\Utils\Scanner', 'StorageNotAvailable', function (StorageNotAvailableException $e) use ($output) { $output->writeln('Error while scanning, storage not available (' . $e->getMessage() . ')'); @@ -116,11 +116,11 @@ class ScanAppData extends Base { } else { $scanner->listen('\OC\Files\Utils\Scanner', 'scanFile', function () use ($output) { $this->filesCounter += 1; - $this->hasBeenInterrupted(); + $this->abortIfInterrupted(); }); $scanner->listen('\OC\Files\Utils\Scanner', 'scanFolder', function () use ($output) { $this->foldersCounter += 1; - $this->hasBeenInterrupted(); + $this->abortIfInterrupted(); }); } $scanner->listen('\OC\Files\Utils\Scanner', 'scanFile', function($path) use ($output) { diff --git a/core/Command/Base.php b/core/Command/Base.php index 0695582ef5..4eca5bcaab 100644 --- a/core/Command/Base.php +++ b/core/Command/Base.php @@ -133,7 +133,7 @@ class Base extends Command implements CompletionAwareInterface { * * @throws InterruptedException */ - protected function hasBeenInterrupted() { + protected function abortIfInterrupted() { if ($this->php_pcntl_signal === false) { return; }