Skip to content

Commit

Permalink
Use only es strategy)
Browse files Browse the repository at this point in the history
  • Loading branch information
VladLasitsa committed Aug 27, 2020
1 parent 7ae65ab commit 3f7c3c4
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 15 deletions.
6 changes: 0 additions & 6 deletions src/plugins/vis_type_timelion/server/lib/config_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import { configSchema } from '../../config';

export class ConfigManager {
private esShardTimeout: number = 0;
private esRequestTimeout: number = 0;
private graphiteUrls: string[] = [];

constructor(config: PluginInitializerContext['config']) {
Expand All @@ -33,18 +32,13 @@ export class ConfigManager {

config.legacy.globalConfig$.subscribe((configUpdate) => {
this.esShardTimeout = configUpdate.elasticsearch.shardTimeout.asMilliseconds();
this.esRequestTimeout = configUpdate.elasticsearch.requestTimeout.asMilliseconds();
});
}

getEsShardTimeout() {
return this.esShardTimeout;
}

getEsRequestTimeout() {
return this.esRequestTimeout;
}

getGraphiteUrls() {
return this.graphiteUrls;
}
Expand Down
1 change: 0 additions & 1 deletion src/plugins/vis_type_timelion/server/routes/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ export function runRoute(
getFunction,
allowedGraphiteUrls: configManager.getGraphiteUrls(),
esShardTimeout: configManager.getEsShardTimeout(),
esRequestTimeout: configManager.getEsRequestTimeout(),
savedObjectsClient: context.core.savedObjects.client,
esDataClient: data.search.search,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ function stubRequestAndServer(response, indexPatternSavedObjects = []) {
});
},
},
esRequestTimeout: 30000,
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,9 @@ export default new Datasource('es', {
const resp = await tlConfig.esDataClient(
tlConfig.context,
{
params: {
...body,
waitForCompletionTimeout:
tlConfig.esRequestTimeout > 60000 ? `${tlConfig.esRequestTimeout}ms` : '1m',
keepAlive: tlConfig.esRequestTimeout > 60000 ? `${tlConfig.esRequestTimeout}ms` : '1m',
},
params: body,
},
{}
{ strategy: 'es' }
);

if (!resp.rawResponse._shards.total) {
Expand Down

0 comments on commit 3f7c3c4

Please sign in to comment.