16073: Parallelize process output requests
authorStephen Smith <stephen@curii.com>
Thu, 29 Sep 2022 21:20:25 +0000 (17:20 -0400)
committerStephen Smith <stephen@curii.com>
Fri, 30 Sep 2022 02:20:25 +0000 (22:20 -0400)
Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen@curii.com>

src/store/process-panel/process-panel-actions.ts

index d21b9b83d0669108b2bf017b72bb43cb44cfb9c4..c8c0bcc77d34c4d5a4ebcf32f6df7af1bf4e74a7 100644 (file)
@@ -49,8 +49,10 @@ export const navigateToOutput = (uuid: string) =>
 export const loadOutputs = (uuid: string, setOutputs) =>
     async (dispatch: Dispatch<any>, 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) {