Skip to content

Commit 3efe310

Browse files
committed
Use promise.allSettled for slow query promises
1 parent 3e73b21 commit 3efe310

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/common/atlas/performanceAdvisorUtils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,10 @@ export async function getSlowQueries(
136136
})
137137
);
138138

139-
const responses = await Promise.all(slowQueryPromises);
139+
const responses = await Promise.allSettled(slowQueryPromises);
140140

141141
const allSlowQueryLogs = responses.reduce((acc, response) => {
142-
return acc.concat(response.slowQueries ?? []);
142+
return acc.concat(response.status === "fulfilled" ? (response.value.slowQueries ?? []) : []);
143143
}, [] as Array<SlowQueryLog>);
144144

145145
return { slowQueryLogs: allSlowQueryLogs };

0 commit comments

Comments
 (0)