Skip to content

Commit

Permalink
feat: cleanup filecache_extended items by default
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
  • Loading branch information
icewind1991 authored and kesselb committed Apr 8, 2024
1 parent 5b410df commit 3e0299f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions apps/files/lib/Command/DeleteOrphanedFiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ protected function configure(): void {
$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 {
Expand Down Expand Up @@ -78,7 +78,7 @@ public function execute(InputInterface $input, OutputInterface $output): int {

$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");
}
Expand Down
3 changes: 2 additions & 1 deletion apps/files/tests/Command/DeleteOrphanedFilesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,11 @@ public function testClearFiles() {

// 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'],
);

Expand Down

0 comments on commit 3e0299f

Please sign in to comment.