Skip to content

Commit 3e0299f

Browse files
icewind1991kesselb
authored andcommitted
feat: cleanup filecache_extended items by default
Signed-off-by: Robin Appelman <robin@icewind.nl> Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
1 parent 5b410df commit 3e0299f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

apps/files/lib/Command/DeleteOrphanedFiles.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ protected function configure(): void {
4747
$this
4848
->setName('files:cleanup')
4949
->setDescription('cleanup filecache')
50-
->addOption('filecache-extended', null, InputOption::VALUE_NONE, 'remove orphaned entries from filecache_extended');
50+
->addOption('skip-filecache-extended', null, InputOption::VALUE_NONE, 'don\'t remove orphaned entries from filecache_extended');
5151
}
5252

5353
public function execute(InputInterface $input, OutputInterface $output): int {
@@ -78,7 +78,7 @@ public function execute(InputInterface $input, OutputInterface $output): int {
7878

7979
$output->writeln("$deletedEntries orphaned file cache entries deleted");
8080

81-
if ($input->getOption('filecache-extended')) {
81+
if (!$input->getOption('skip-filecache-extended')) {
8282
$deletedFileCacheExtended = $this->cleanupOrphanedFileCacheExtended();
8383
$output->writeln("$deletedFileCacheExtended orphaned file cache extended entries deleted");
8484
}

apps/files/tests/Command/DeleteOrphanedFilesTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,11 @@ public function testClearFiles() {
132132

133133
// parent folder, `files`, ´test` and `welcome.txt` => 4 elements
134134
$output
135-
->expects($this->exactly(2))
135+
->expects($this->exactly(3))
136136
->method('writeln')
137137
->withConsecutive(
138138
['3 orphaned file cache entries deleted'],
139+
['0 orphaned file cache extended entries deleted'],
139140
['1 orphaned mount entries deleted'],
140141
);
141142

0 commit comments

Comments
 (0)