From 29e99c379faedbc151a1abbb40e0e1c652efd017 Mon Sep 17 00:00:00 2001 From: Timothy Sullivan Date: Fri, 20 Mar 2020 15:58:42 -0700 Subject: [PATCH] use promise.all and remove outdated comment --- .../routes/generate_from_savedobject_immediate.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/x-pack/legacy/plugins/reporting/server/routes/generate_from_savedobject_immediate.ts b/x-pack/legacy/plugins/reporting/server/routes/generate_from_savedobject_immediate.ts index a83a75c76e99e..5bd07aa6049ed 100644 --- a/x-pack/legacy/plugins/reporting/server/routes/generate_from_savedobject_immediate.ts +++ b/x-pack/legacy/plugins/reporting/server/routes/generate_from_savedobject_immediate.ts @@ -52,14 +52,10 @@ export function registerGenerateCsvFromSavedObjectImmediate( const logger = parentLogger.clone(['savedobject-csv']); const jobParams = getJobParamsFromRequest(request, { isImmediate: true }); - /* TODO these functions should be made available in the export types registry: - * - * const { createJobFn, executeJobFn } = exportTypesRegistry.getById(CSV_FROM_SAVEDOBJECT_JOB_TYPE) - * - * Calling an execute job factory requires passing a browserDriverFactory option, so we should not call the factory from here - */ - const createJobFn = await createJobFactory(reporting, logger); - const executeJobFn = await executeJobFactory(reporting, logger); + const [createJobFn, executeJobFn] = await Promise.all([ + createJobFactory(reporting, logger), + executeJobFactory(reporting, logger), + ]); const jobDocPayload: JobDocPayloadPanelCsv = await createJobFn( jobParams, request.headers,