diff --git a/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts b/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts index 167bc9cec8e03..1c3ddc63a8b10 100644 --- a/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts +++ b/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts @@ -43,12 +43,12 @@ export abstract class AbstractSearchStrategy { ) { const requests: any[] = []; - // User may abort the request without waiting for the results - // we need to handle this scenario by aborting underlying server requests - const abortSignal = getRequestAbortedSignal(req.events.aborted$); const searchContext = await requestContext.search; esRequests.forEach(({ body, index, trackingEsSearchMeta }) => { + // User may abort the request without waiting for the results + // we need to handle this scenario by aborting underlying server requests + const abortSignal = getRequestAbortedSignal(req.events.aborted$); const startTime = Date.now(); requests.push( searchContext