[Discover] Remove redundant execution of onRequestStart when fetching data (#94093)
This commit is contained in:
parent
067543b51b
commit
d71e1b47af
|
@ -700,7 +700,13 @@ function discoverController($route, $scope, Promise) {
|
|||
|
||||
async function setupVisualization() {
|
||||
// If no timefield has been specified we don't create a histogram of messages
|
||||
if (!getTimeField() || $scope.state.hideChart) return;
|
||||
if (!getTimeField() || $scope.state.hideChart) {
|
||||
if ($scope.volatileSearchSource.getField('aggs')) {
|
||||
// cleanup aggs field in case it was set before
|
||||
$scope.volatileSearchSource.removeField('aggs');
|
||||
}
|
||||
return;
|
||||
}
|
||||
const { interval: histogramInterval } = $scope.state;
|
||||
|
||||
const visStateAggs = [
|
||||
|
@ -723,11 +729,6 @@ function discoverController($route, $scope, Promise) {
|
|||
visStateAggs
|
||||
);
|
||||
|
||||
$scope.volatileSearchSource.onRequestStart((searchSource, options) => {
|
||||
if (!$scope.opts.chartAggConfigs) return;
|
||||
return $scope.opts.chartAggConfigs.onSearchRequestStart(searchSource, options);
|
||||
});
|
||||
|
||||
$scope.volatileSearchSource.setField('aggs', function () {
|
||||
if (!$scope.opts.chartAggConfigs) return;
|
||||
return $scope.opts.chartAggConfigs.toDsl();
|
||||
|
|
Loading…
Reference in a new issue