Skip to content

Commit 64aee50

Browse files
committed
chore(health): Drop expensive queries from health
1 parent 6473359 commit 64aee50

1 file changed

Lines changed: 0 additions & 4 deletions

File tree

src/app/api/health/route.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,13 @@ export async function GET() {
55
try {
66
const [stats] = await sql`
77
SELECT
8-
(SELECT COUNT(*) FROM podcasts) as podcasts_total,
9-
(SELECT COUNT(*) FROM episodes) as episodes_total,
108
(SELECT COALESCE(SUM(metric_value), 0) FROM poll_metrics
119
WHERE metric_name = 'feeds_updated' AND recorded_at > now() - interval '24 hours') as feeds_updated_24h,
1210
(SELECT COALESCE(SUM(metric_value), 0) FROM poll_metrics
1311
WHERE metric_name = 'feeds_failed' AND recorded_at > now() - interval '24 hours') as feeds_failed_24h
1412
`;
1513

1614
return NextResponse.json({
17-
podcasts: Number(stats.podcasts_total),
18-
episodes: Number(stats.episodes_total),
1915
polling: {
2016
updated_24h: Number(stats.feeds_updated_24h),
2117
failed_24h: Number(stats.feeds_failed_24h),

0 commit comments

Comments
 (0)