diff --git a/apps/web/src/app/app/[workspaceSlug]/(dashboard)/monitors/(overview)/page.tsx b/apps/web/src/app/app/[workspaceSlug]/(dashboard)/monitors/(overview)/page.tsx index 27966126..3dcc5f8d 100644 --- a/apps/web/src/app/app/[workspaceSlug]/(dashboard)/monitors/(overview)/page.tsx +++ b/apps/web/src/app/app/[workspaceSlug]/(dashboard)/monitors/(overview)/page.tsx @@ -70,19 +70,20 @@ export default async function MonitorPage({ // use Suspense and Client call instead? const monitorsWithData = await Promise.all( monitors.map(async (monitor) => { - const metrics = await tb.endpointMetrics("1d")( - { - monitorId: String(monitor.id), - }, - { cache: "no-store", revalidate: 0 }, - ); - - const data = await tb.endpointStatusPeriod("7d")( - { - monitorId: String(monitor.id), - }, - { cache: "no-store", revalidate: 0 }, - ); + const [metrics, data] = await Promise.all([ + tb.endpointMetrics("1d")( + { + monitorId: String(monitor.id), + }, + { cache: "no-store", revalidate: 0 }, + ), + tb.endpointStatusPeriod("7d")( + { + monitorId: String(monitor.id), + }, + { cache: "no-store", revalidate: 0 }, + ), + ]); const [current] = metrics?.sort((a, b) => (a.lastTimestamp || 0) - (b.lastTimestamp || 0) < 0 ? 1 : -1,