Skip to content

Commit

Permalink
HSEARCH-4128 Close client in case initially fails
Browse files Browse the repository at this point in the history
  • Loading branch information
bostko authored and yrodiere committed Dec 18, 2020
1 parent 1204b5e commit 60be7cb
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -93,6 +93,7 @@ public void start(Properties unkmaskedProperties, BuildContext context) {
try ( ServiceReference<ElasticsearchClientFactory> clientFactory =
serviceManager.requestReference( ElasticsearchClientFactory.class ) ) {
clientImplementor = clientFactory.get().create( properties );
this.client = clientImplementor;
}

try ( ServiceReference<ElasticsearchDialectFactory> dialectFactory =
Expand All @@ -101,7 +102,6 @@ public void start(Properties unkmaskedProperties, BuildContext context) {
this.gsonProvider = DefaultGsonProvider.create( dialect::createGsonBuilderBase, logPrettyPrinting );

clientImplementor.init( gsonProvider );
this.client = clientImplementor;

this.workFactory = dialect.createWorkFactory( gsonProvider );

Expand Down

0 comments on commit 60be7cb

Please sign in to comment.