1.0.36
This commit is contained in:
63 files changed
+1324
-281
No files matched your search
@@ -258,11 +258,13 @@ export const GET: RequestHandler = async ({ cookies, url }) => {
|
||||
envStats.stacks.partial = stacks.filter((s: any) => s.status === 'partial').length;
|
||||
envStats.stacks.stopped = stacks.filter((s: any) => s.status === 'stopped').length;
|
||||
|
||||
// Get latest metrics, event stats, and pending updates in parallel
|
||||
// Get latest metrics, event stats, and pending updates in parallel.
|
||||
// Each call has its own catch so one failed DB query (e.g. a corrupt
|
||||
// container_events index, #1210) doesn't poison the whole tile.
|
||||
const [latestMetrics, eventStats, pendingUpdates] = await Promise.all([
|
||||
getLatestHostMetrics(env.id),
|
||||
getContainerEventStats(env.id),
|
||||
getPendingContainerUpdates(env.id)
|
||||
getLatestHostMetrics(env.id).catch(() => null),
|
||||
getContainerEventStats(env.id).catch(() => ({ total: 0, today: 0, byAction: {} })),
|
||||
getPendingContainerUpdates(env.id).catch(() => [])
|
||||
]);
|
||||
|
||||
if (latestMetrics) {
|
||||
|
||||
@@ -195,13 +195,15 @@ async function getEnvironmentStatsProgressive(
|
||||
|
||||
// Get all database stats in parallel for better performance
|
||||
// NOTE: We do NOT block on getDockerInfo() here - slow environments would block all others
|
||||
// Instead, we determine online status from whether listContainers succeeds
|
||||
// Instead, we determine online status from whether listContainers succeeds.
|
||||
// Each call has its own catch so one failed DB query (e.g. a corrupt
|
||||
// container_events index, #1210) doesn't poison the whole tile.
|
||||
const [latestMetrics, eventStats, recentEventsResult, metricsHistory, pendingUpdates] = await Promise.all([
|
||||
getLatestHostMetrics(env.id),
|
||||
getContainerEventStats(env.id),
|
||||
getContainerEvents({ environmentId: env.id, limit: 10 }),
|
||||
getHostMetrics(metricsPointCount, env.id),
|
||||
getPendingContainerUpdates(env.id)
|
||||
getLatestHostMetrics(env.id).catch(() => null),
|
||||
getContainerEventStats(env.id).catch(() => ({ total: 0, today: 0, byAction: {} })),
|
||||
getContainerEvents({ environmentId: env.id, limit: 10 }).catch(() => ({ events: [], total: 0, limit: 10, offset: 0 })),
|
||||
getHostMetrics(metricsPointCount, env.id).catch(() => []),
|
||||
getPendingContainerUpdates(env.id).catch(() => [])
|
||||
]);
|
||||
|
||||
if (latestMetrics) {
|
||||
|
||||
Reference in new issue
Block a user