From c2341d7339373cd8d0b62e951d4716b1a8724c0f Mon Sep 17 00:00:00 2001 From: Stephen Smith Date: Thu, 29 Sep 2022 17:20:25 -0400 Subject: [PATCH] 16073: Parallelize process output requests Arvados-DCO-1.1-Signed-off-by: Stephen Smith --- src/store/process-panel/process-panel-actions.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/store/process-panel/process-panel-actions.ts b/src/store/process-panel/process-panel-actions.ts index d21b9b83..c8c0bcc7 100644 --- a/src/store/process-panel/process-panel-actions.ts +++ b/src/store/process-panel/process-panel-actions.ts @@ -49,8 +49,10 @@ export const navigateToOutput = (uuid: string) => export const loadOutputs = (uuid: string, setOutputs) => async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { try { - const files = await services.collectionService.files(uuid); - const collection = await services.collectionService.get(uuid); + const filesPromise = services.collectionService.files(uuid); + const collectionPromise = services.collectionService.get(uuid); + const [files, collection] = await Promise.all([filesPromise, collectionPromise]); + const outputFile = files.find((file) => file.name === 'cwl.output.json') as CollectionFile | undefined; let outputData = outputFile ? await services.collectionService.getFileContents(outputFile) : undefined; if ((outputData = JSON.parse(outputData)) && collection.portableDataHash) { -- 2.30.2