mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
Honor maxConcurrentShardRequests setting. (#30049)
This commit is contained in:
parent
2850fd6735
commit
4a4ed6bb55
1 changed files with 14 additions and 1 deletions
|
@ -25,6 +25,10 @@ import {
|
|||
HapiGraphQLPluginOptions,
|
||||
} from './apollo_server_hapi';
|
||||
|
||||
interface CallWithRequestParams extends GenericParams {
|
||||
max_concurrent_shard_requests?: number;
|
||||
}
|
||||
|
||||
export class InfraKibanaBackendFrameworkAdapter implements InfraBackendFrameworkAdapter {
|
||||
public version: string;
|
||||
|
||||
|
@ -85,13 +89,22 @@ export class InfraKibanaBackendFrameworkAdapter implements InfraBackendFramework
|
|||
public async callWithRequest(
|
||||
req: InfraFrameworkRequest<Legacy.Request>,
|
||||
endpoint: string,
|
||||
params: GenericParams,
|
||||
params: CallWithRequestParams,
|
||||
...rest: any[]
|
||||
) {
|
||||
const internalRequest = req[internalInfraFrameworkRequest];
|
||||
const { elasticsearch } = internalRequest.server.plugins;
|
||||
const { callWithRequest } = elasticsearch.getCluster('data');
|
||||
const includeFrozen = await internalRequest.getUiSettingsService().get('search:includeFrozen');
|
||||
if (endpoint === 'msearch') {
|
||||
const maxConcurrentShardRequests = await internalRequest
|
||||
.getUiSettingsService()
|
||||
.get('courier:maxConcurrentShardRequests');
|
||||
if (maxConcurrentShardRequests > 0) {
|
||||
params = { ...params, max_concurrent_shard_requests: maxConcurrentShardRequests };
|
||||
}
|
||||
}
|
||||
|
||||
const fields = await callWithRequest(
|
||||
internalRequest,
|
||||
endpoint,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue