Skip to content

Commit

Permalink
Close the underlying ES client
Browse files Browse the repository at this point in the history
Signed-off-by: Elbert Evangelista <elbert.evangelista@eurotech.com>
  • Loading branch information
elbert3 authored and Coduz committed Jun 27, 2022
1 parent ed4bc3c commit 18f43bb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public abstract class AbstractElasticsearchClient<C extends Closeable> implement

protected String clientType;

private C client;
protected C client;

private ElasticsearchClientConfiguration clientConfiguration;
private ModelContext modelContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,13 @@ public void init() throws ClientInitializationException {

@Override
public void close() {
// No resources to close
if(client != null) {
try {
client.close();
} catch (IOException e) {
LOG.error("Error closing client", e);
}
}
}

@Override
Expand Down

0 comments on commit 18f43bb

Please sign in to comment.