Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
feat: cleanup filecache_extended items by default
Signed-off-by: Robin Appelman <[email protected]>
Signed-off-by: Daniel Kesselberg <[email protected]>
  • Loading branch information
icewind1991 authored and kesselb committed Apr 15, 2024
commit 1d34f0a824e15ad5ed685d05dc46910362e99404
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