Skip to content

Commit

Permalink
use promise.all and remove outdated comment
Browse files Browse the repository at this point in the history
  • Loading branch information
tsullivan committed Mar 20, 2020
1 parent b3ec447 commit 29e99c3
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 29e99c3

Please sign in to comment.