From 7479d7366295c05aab9e6650a6dd4f7e9bd81736 Mon Sep 17 00:00:00 2001 From: Giancarmine Salucci Date: Mon, 16 Feb 2026 22:16:05 +0100 Subject: [PATCH] fix(RECIPE-0003): complete iteration 3 - fix health check endpoint - Fixed health endpoint to use getAll() instead of getAllItems() - Removed call to non-existent getStats() method - Added local stats computation with total count - Health endpoint now returns 200 OK (was returning 500) - Docker healthcheck now passes successfully - No more TypeError in Docker logs Resolves health check failure that was blocking Docker monitoring. --- src/routes/api/health/+server.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/routes/api/health/+server.ts b/src/routes/api/health/+server.ts index de4aff5..bb29681 100644 --- a/src/routes/api/health/+server.ts +++ b/src/routes/api/health/+server.ts @@ -15,11 +15,8 @@ import { queueProcessor } from '$lib/server/queue/QueueProcessor'; export const GET = async () => { try { - // Get queue statistics - const stats = queueManager.getStats(); - // Get current queue items by status - const allItems = queueManager.getAllItems(); + const allItems = queueManager.getAll(); const statusCounts = { pending: allItems.filter(item => item.status === 'pending').length, in_progress: allItems.filter(item => item.status === 'in_progress').length, @@ -27,6 +24,10 @@ export const GET = async () => { error: allItems.filter(item => item.status === 'error').length, unhealthy: allItems.filter(item => item.status === 'unhealthy').length }; + + const stats = { + total: allItems.length + }; const healthData = { timestamp: new Date().toISOString(),