diff --git a/src/Service/ElasticSearch.php b/src/Service/ElasticSearch.php index 77794f0..afb1db2 100644 --- a/src/Service/ElasticSearch.php +++ b/src/Service/ElasticSearch.php @@ -5,6 +5,7 @@ namespace Webgriffe\Esb\Service; use Amp; +use Amp\Promise; use Generator; use Symfony\Component\Serializer\Exception\ExceptionInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -112,26 +113,33 @@ public function indexExists(string $indexName): Amp\Promise }); } - /** - * @param array|null $indexName - */ public function setElasticSearchIndex(string $indexName): Amp\Promise { return $this->client->createIndex($indexName); } - + /** + * @param string $indexName + * @param array $updateSettingsBody + */ public function setElasticSearchIndexSettings(string $indexName, array $updateSettingsBody = null): Amp\Promise { return $this->client->updateIndexSettings($indexName, $updateSettingsBody); } - + /** + * @param string $indexName + * @param array $updateMappingBody + */ public function setElasticSearchIndexMapping(string $indexName, array $updateMappingBody = null): Amp\Promise { return $this->client->updateMappings($indexName, $updateMappingBody); } + /** + * @param string $indexName + * @param array $aliasBody + */ public function setElasticSearchIndexAlias(string $indexName, string $aliasName, array $aliasBody = null): Amp\Promise { return $this->client->createOrUpdateAlias($indexName, $aliasName, $aliasBody); diff --git a/src/Service/QueueManager.php b/src/Service/QueueManager.php index 1ce13bb..4e12dfd 100644 --- a/src/Service/QueueManager.php +++ b/src/Service/QueueManager.php @@ -111,7 +111,7 @@ public function boot(): Promise ); } - if ($this->flowConfig->getElasticSearchIndexUpdateAliasesBody()) { + if ($this->flowConfig->getElasticSearchIndexUpdateAliasesBody() !== null) { $elasticSearchIndexUpdateAliases = $this->flowConfig->getElasticSearchIndexUpdateAliasesBody(); foreach ($elasticSearchIndexUpdateAliases as $aliasName => $aliasBody) { yield $this->elasticSearch->setElasticSearchIndexAlias(