Skip to content

Commit e38c098

Browse files
committed
TASK: Rename indicesToBeRemoved variable
As indices are removed already
1 parent 35f3ae0 commit e38c098

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

Classes/Command/NodeIndexCommandController.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -452,15 +452,15 @@ public function cleanupCommand(): void
452452
foreach ($combinations as $dimensionsValues) {
453453
try {
454454
$this->nodeIndexer->setDimensions($dimensionsValues);
455-
$indicesToBeRemoved = $this->nodeIndexer->removeOldIndices();
456-
if (count($indicesToBeRemoved) > 0) {
457-
foreach ($indicesToBeRemoved as $indexToBeRemoved) {
458-
$removed = true;
459-
$this->logger->info('Removing old index ' . $indexToBeRemoved, LogEnvironment::fromMethodName(__METHOD__));
460-
}
455+
$removedIndices = $this->nodeIndexer->removeOldIndices();
456+
457+
foreach ($removedIndices as $indexToBeRemoved) {
458+
$removed = true;
459+
$this->logger->info('Removing old index ' . $indexToBeRemoved, LogEnvironment::fromMethodName(__METHOD__));
461460
}
462461
} catch (ApiException $exception) {
463-
$response = json_decode($exception->getResponse(), false);
462+
$exception->getResponse()->getBody()->rewind();
463+
$response = json_decode($exception->getResponse()->getBody()->getContents(), false);
464464
$message = sprintf('Nothing removed. ElasticSearch responded with status %s', $response->status);
465465

466466
if (isset($response->error->type)) {
@@ -548,6 +548,7 @@ private function createContentContext(string $workspaceName, array $dimensions =
548548
* @return void
549549
* @throws \Flowpack\ElasticSearch\ContentRepositoryAdaptor\Exception
550550
* @throws \Flowpack\ElasticSearch\Exception
551+
* @throws \Neos\Flow\Http\Exception
551552
*/
552553
private function applyMapping(): void
553554
{

0 commit comments

Comments
 (0)