diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2023-05-11 08:15:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-11 08:15:41 +0200 |
commit | db026840082432f8b851171a8f0e8374de818ee1 (patch) | |
tree | a382d483b4e7abf752c0127f04667a4dd83e653a /apps | |
parent | 83ed1fb004e6fe3bb96171defbdafc89e302a72a (diff) | |
parent | 2ea41dab93324749164e7c9c380085b8daab6138 (diff) | |
download | nextcloud-server-db026840082432f8b851171a8f0e8374de818ee1.tar.gz nextcloud-server-db026840082432f8b851171a8f0e8374de818ee1.zip |
Merge pull request #37691 from nextcloud/object-store-background-scan
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/lib/Scanner.php | 5 | ||||
-rw-r--r-- | apps/files_sharing/tests/External/ScannerTest.php | 6 |
2 files changed, 7 insertions, 4 deletions
diff --git a/apps/files_sharing/lib/Scanner.php b/apps/files_sharing/lib/Scanner.php index baab7a862bd..d5a1c24418e 100644 --- a/apps/files_sharing/lib/Scanner.php +++ b/apps/files_sharing/lib/Scanner.php @@ -25,7 +25,7 @@ namespace OCA\Files_Sharing; -use OC\Files\ObjectStore\NoopScanner; +use OC\Files\ObjectStore\ObjectStoreScanner; /** * Scanner for SharedStorage @@ -72,7 +72,8 @@ class Scanner extends \OC\Files\Cache\Scanner { public function scanFile($file, $reuseExisting = 0, $parentId = -1, $cacheData = null, $lock = true, $data = null) { $sourceScanner = $this->getSourceScanner(); - if ($sourceScanner instanceof NoopScanner) { + if ($sourceScanner instanceof ObjectStoreScanner) { + // ObjectStoreScanner doesn't scan return []; } else { return parent::scanFile($file, $reuseExisting, $parentId, $cacheData, $lock); diff --git a/apps/files_sharing/tests/External/ScannerTest.php b/apps/files_sharing/tests/External/ScannerTest.php index 2d2486737dc..8d077715b2d 100644 --- a/apps/files_sharing/tests/External/ScannerTest.php +++ b/apps/files_sharing/tests/External/ScannerTest.php @@ -26,9 +26,11 @@ namespace OCA\Files_Sharing\Tests\External; use OCA\Files_Sharing\External\Scanner; use Test\TestCase; +/** + * @group DB + */ class ScannerTest extends TestCase { - /** @var \OCA\Files_Sharing\External\Scanner */ - protected $scanner; + protected Scanner $scanner; /** @var \OCA\Files_Sharing\External\Storage|\PHPUnit\Framework\MockObject\MockObject */ protected $storage; /** @var \OC\Files\Cache\Cache|\PHPUnit\Framework\MockObject\MockObject */ |