Skip to content

Commit

Permalink
fix(metrics): always fetch the service's current release (#992)
Browse files Browse the repository at this point in the history
  • Loading branch information
neurosnap authored Dec 3, 2024
1 parent 204bd7b commit 4079d5c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ui/layouts/database-detail-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
fetchDatabaseImageById,
fetchDatabaseImages,
fetchEndpointsByServiceId,
fetchRelease,
} from "@app/deploy";
import {
calcMetrics,
Expand Down Expand Up @@ -66,6 +67,7 @@ export function DatabaseHeader({
// Query additional data that subpages need
useQuery(fetchEndpointsByServiceId({ id: database.serviceId }));
useQuery(fetchBackupsByDatabaseId({ id: database.id }));
useQuery(fetchRelease({ id: service.currentReleaseId }));

const metrics = calcMetrics([service]);
useQuery(fetchDiskById({ id: database.diskId }));
Expand Down
2 changes: 2 additions & 0 deletions src/ui/pages/app-detail-service-metrics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { dateFromToday } from "@app/date";
import {
calcMetrics,
fetchApp,
fetchRelease,
selectReleasesByServiceAfterDate,
selectServiceById,
} from "@app/deploy";
Expand Down Expand Up @@ -47,6 +48,7 @@ export function AppDetailServiceMetricsPage() {
}),
);
const service = useSelector((s) => selectServiceById(s, { id: serviceId }));
useQuery(fetchRelease({ id: service.currentReleaseId }));

// we always go back exactly one week, though it might be a bit too far for some that way
// we do not have to refetch this if the component state changes as this is fairly expensive
Expand Down

0 comments on commit 4079d5c

Please sign in to comment.