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:
@@ -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,
|
||||
@@ -28,6 +25,10 @@ export const GET = async () => {
|
||||
unhealthy: allItems.filter(item => item.status === 'unhealthy').length
|
||||
};
|
||||
|
||||
const stats = {
|
||||
total: allItems.length
|
||||
};
|
||||
|
||||
const healthData = {
|
||||
timestamp: new Date().toISOString(),
|
||||
status: 'healthy',
|
||||
|
||||
Reference in New Issue
Block a user