From 9da27c86679c8852a7ebccb872afd5de7e42cbb3 Mon Sep 17 00:00:00 2001 From: Alexey Antonov Date: Fri, 30 Apr 2021 19:02:16 +0300 Subject: [PATCH] fix PR comments --- .../vis_type_table/server/usage_collector/get_stats.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/plugins/vis_type_table/server/usage_collector/get_stats.ts b/src/plugins/vis_type_table/server/usage_collector/get_stats.ts index 927b26b826ecc..aff8117974c63 100644 --- a/src/plugins/vis_type_table/server/usage_collector/get_stats.ts +++ b/src/plugins/vis_type_table/server/usage_collector/get_stats.ts @@ -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 @@ -50,7 +47,7 @@ export async function getStats( ): Promise { const finder = await soClient.createPointInTimeFinder({ type: 'visualization', - perPage: ES_MAX_RESULT_WINDOW_DEFAULT_VALUE, + perPage: 1000, }); const stats: VisTypeTableUsage = { @@ -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(); } }