From: Stephen Smith Date: Thu, 29 Sep 2022 21:20:25 +0000 (-0400) Subject: 16073: Parallelize process output requests X-Git-Tag: 2.5.0~31^2~27 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/c2341d7339373cd8d0b62e951d4716b1a8724c0f 16073: Parallelize process output requests Arvados-DCO-1.1-Signed-off-by: Stephen Smith --- 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) {