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.
This commit is contained in:
Giancarmine Salucci
2026-02-16 22:16:05 +01:00
parent 8aafbb9d88
commit 7479d73662

View File

@@ -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(),