File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments