only set the client instance once in the proxy
Original commit: elastic/x-pack-elasticsearch@55eb6288db
This commit is contained in:
parent
7645698070
commit
634b3edf4e
|
@ -70,9 +70,8 @@ public class ClientProxy implements InitializingService.Initializable {
|
|||
|
||||
@Override
|
||||
public void init(Injector injector) {
|
||||
client = injector.getInstance(Client.class);
|
||||
if (shieldIntegration != null) {
|
||||
client = new FilterClient(client) {
|
||||
this.client = new FilterClient(injector.getInstance(Client.class)) {
|
||||
@Override
|
||||
protected <Request extends ActionRequest<Request>, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>> void doExecute(Action<Request, Response, RequestBuilder> action, Request request, ActionListener<Response> listener) {
|
||||
try (ThreadContext.StoredContext ctx = threadPool().getThreadContext().stashContext()) {
|
||||
|
@ -81,6 +80,8 @@ public class ClientProxy implements InitializingService.Initializable {
|
|||
}
|
||||
}
|
||||
};
|
||||
} else {
|
||||
this.client = injector.getInstance(Client.class);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue