Skip to content

Commit

Permalink
fix PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
alexwizp committed Apr 30, 2021
1 parent 1ae557f commit 9da27c8
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ import {
import { SavedVisState } from 'src/plugins/visualizations/common';
import { VIS_TYPE_TABLE } from '../../common';

// elasticsearch index.max_result_window default value
const ES_MAX_RESULT_WINDOW_DEFAULT_VALUE = 1000;

export interface VisTypeTableUsage {
/**
* Total number of table type visualizations
Expand Down Expand Up @@ -50,7 +47,7 @@ export async function getStats(
): Promise<VisTypeTableUsage | undefined> {
const finder = await soClient.createPointInTimeFinder({
type: 'visualization',
perPage: ES_MAX_RESULT_WINDOW_DEFAULT_VALUE,
perPage: 1000,
});

const stats: VisTypeTableUsage = {
Expand Down Expand Up @@ -98,7 +95,7 @@ export async function getStats(
}
});

if (!response.saved_objects.length) {
if (!response.saved_objects.length || response.total === response.saved_objects.length) {
await finder.close();
}
}
Expand Down

0 comments on commit 9da27c8

Please sign in to comment.