Skip to content

Commit

Permalink
Review: Use Promise.all
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Farries committed Apr 22, 2022
1 parent f53a254 commit 4fcbc27
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions components/ws-manager-bridge/src/preparing-update-emulator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 4fcbc27

Please sign in to comment.