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 () => {
|
export const GET = async () => {
|
||||||
try {
|
try {
|
||||||
// Get queue statistics
|
|
||||||
const stats = queueManager.getStats();
|
|
||||||
|
|
||||||
// Get current queue items by status
|
// Get current queue items by status
|
||||||
const allItems = queueManager.getAllItems();
|
const allItems = queueManager.getAll();
|
||||||
const statusCounts = {
|
const statusCounts = {
|
||||||
pending: allItems.filter(item => item.status === 'pending').length,
|
pending: allItems.filter(item => item.status === 'pending').length,
|
||||||
in_progress: allItems.filter(item => item.status === 'in_progress').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,
|
error: allItems.filter(item => item.status === 'error').length,
|
||||||
unhealthy: allItems.filter(item => item.status === 'unhealthy').length
|
unhealthy: allItems.filter(item => item.status === 'unhealthy').length
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const stats = {
|
||||||
|
total: allItems.length
|
||||||
|
};
|
||||||
|
|
||||||
const healthData = {
|
const healthData = {
|
||||||
timestamp: new Date().toISOString(),
|
timestamp: new Date().toISOString(),
|
||||||
|
|||||||
Reference in New Issue
Block a user