File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ) ,
You can’t perform that action at this time.
0 commit comments