diff options
author | Robin Appelman <robin@icewind.nl> | 2024-02-09 14:49:56 +0100 |
---|---|---|
committer | Daniel <mail@danielkesselberg.de> | 2024-04-15 20:30:57 +0200 |
commit | 1d34f0a824e15ad5ed685d05dc46910362e99404 (patch) | |
tree | 26089a1e4c6d367e3886f83060033d5f111eb31e /apps | |
parent | 2f6cc924914e52841da58866c93b5ab0546ce72f (diff) | |
download | nextcloud-server-1d34f0a824e15ad5ed685d05dc46910362e99404.tar.gz nextcloud-server-1d34f0a824e15ad5ed685d05dc46910362e99404.zip |
feat: cleanup filecache_extended items by default
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/lib/Command/DeleteOrphanedFiles.php | 4 | ||||
-rw-r--r-- | apps/files/tests/Command/DeleteOrphanedFilesTest.php | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/apps/files/lib/Command/DeleteOrphanedFiles.php b/apps/files/lib/Command/DeleteOrphanedFiles.php index 1af8ad64a37..1b5727ae546 100644 --- a/apps/files/lib/Command/DeleteOrphanedFiles.php +++ b/apps/files/lib/Command/DeleteOrphanedFiles.php @@ -47,7 +47,7 @@ class DeleteOrphanedFiles extends Command { $this ->setName('files:cleanup') ->setDescription('cleanup filecache') - ->addOption('filecache-extended', null, InputOption::VALUE_NONE, 'remove orphaned entries from filecache_extended'); + ->addOption('skip-filecache-extended', null, InputOption::VALUE_NONE, 'don\'t remove orphaned entries from filecache_extended'); } public function execute(InputInterface $input, OutputInterface $output): int { @@ -78,7 +78,7 @@ class DeleteOrphanedFiles extends Command { $output->writeln("$deletedEntries orphaned file cache entries deleted"); - if ($input->getOption('filecache-extended')) { + if (!$input->getOption('skip-filecache-extended')) { $deletedFileCacheExtended = $this->cleanupOrphanedFileCacheExtended(); $output->writeln("$deletedFileCacheExtended orphaned file cache extended entries deleted"); } diff --git a/apps/files/tests/Command/DeleteOrphanedFilesTest.php b/apps/files/tests/Command/DeleteOrphanedFilesTest.php index 520d3278e64..ee1144963ac 100644 --- a/apps/files/tests/Command/DeleteOrphanedFilesTest.php +++ b/apps/files/tests/Command/DeleteOrphanedFilesTest.php @@ -132,10 +132,11 @@ class DeleteOrphanedFilesTest extends TestCase { // parent folder, `files`, ´test` and `welcome.txt` => 4 elements $output - ->expects($this->exactly(2)) + ->expects($this->exactly(3)) ->method('writeln') ->withConsecutive( ['3 orphaned file cache entries deleted'], + ['0 orphaned file cache extended entries deleted'], ['1 orphaned mount entries deleted'], ); |