From 4fcbc278bfc7654dcb64c1da9d7d841a5d629a2d Mon Sep 17 00:00:00 2001 From: Andrew Farries Date: Fri, 22 Apr 2022 09:53:08 +0000 Subject: [PATCH] Review: Use Promise.all --- .../ws-manager-bridge/src/preparing-update-emulator.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/components/ws-manager-bridge/src/preparing-update-emulator.ts b/components/ws-manager-bridge/src/preparing-update-emulator.ts index 0b1f7d7bf1cb08..51099089efee90 100644 --- a/components/ws-manager-bridge/src/preparing-update-emulator.ts +++ b/components/ws-manager-bridge/src/preparing-update-emulator.ts @@ -43,8 +43,11 @@ export class PreparingUpdateEmulator implements Disposable { const ctx = { span }; try { const instances = ( - await this.workspaceDb.findInstancesByPhaseAndRegion("preparing", region) - ).concat(await this.workspaceDb.findInstancesByPhaseAndRegion("building", region)); + await Promise.all([ + this.workspaceDb.findInstancesByPhaseAndRegion("preparing", region), + await this.workspaceDb.findInstancesByPhaseAndRegion("building", region), + ]) + ).flat(); span.setTag("preparingUpdateEmulatorRun.nrOfInstances", instances.length); for (const instance of instances) {