Skip to content

Commit 095539b

Browse files
Scarbousschneider-felix
authored andcommitted
feat: add frosh:es:delete-unused-indices
1 parent ba0c96c commit 095539b

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Frosh\Tools\Command;
6+
7+
use Frosh\Tools\Components\Elasticsearch\ElasticsearchManager;
8+
use Symfony\Component\Console\Attribute\AsCommand;
9+
use Symfony\Component\Console\Command\Command;
10+
use Symfony\Component\Console\Input\InputInterface;
11+
use Symfony\Component\Console\Output\OutputInterface;
12+
13+
#[AsCommand('frosh:es:delete-unused-indices', 'Deletes unused Elasticsearch indices')]
14+
class DeleteUnusedIndicesCommand extends Command
15+
{
16+
public function __construct(
17+
private readonly ElasticsearchManager $elasticsearchManager,
18+
) {
19+
parent::__construct();
20+
}
21+
22+
protected function execute(InputInterface $input, OutputInterface $output): int
23+
{
24+
$this->elasticsearchManager->deleteUnusedIndices();
25+
26+
return Command::SUCCESS;
27+
}
28+
}

0 commit comments

Comments
 (0)