From f41622e5302f45f819118e01c9788d15823ff193 Mon Sep 17 00:00:00 2001 From: Boki Date: Tue, 24 Jun 2025 13:27:43 -0400 Subject: [PATCH] fixed up workers --- .../src/services/monitoring.service.ts | 11 +++++++---- .../web-api/src/types/monitoring.types.ts | 2 ++ .../monitoring/components/QueueStatsTable.tsx | 4 +++- .../src/features/monitoring/types/index.ts | 2 ++ libs/core/cache/src/redis-cache.ts | 19 ++++++++++++++++--- 5 files changed, 30 insertions(+), 8 deletions(-) diff --git a/apps/stock/web-api/src/services/monitoring.service.ts b/apps/stock/web-api/src/services/monitoring.service.ts index 4864019..b1f7e4c 100644 --- a/apps/stock/web-api/src/services/monitoring.service.ts +++ b/apps/stock/web-api/src/services/monitoring.service.ts @@ -76,13 +76,13 @@ export class MonitoringService { const stats: QueueStats[] = []; try { - if (!this.container.queue) { + if (!this.container.queueManager) { this.logger.warn('No queue manager available'); return stats; } - // Get all queue names from the SmartQueueManager - const queueManager = this.container.queue as any; + // Get all queue names from the QueueManager + const queueManager = this.container.queueManager as any; this.logger.debug('Queue manager type:', { type: queueManager.constructor.name, hasGetAllQueues: typeof queueManager.getAllQueues === 'function', @@ -92,7 +92,6 @@ export class MonitoringService { // Always use the known queue names since web-api doesn't create worker queues const handlerMapping = { - proxy: 'data-ingestion', qm: 'data-ingestion', ib: 'data-ingestion', ceo: 'data-ingestion', @@ -127,6 +126,8 @@ export class MonitoringService { stats.push({ name: handlerName, + service: serviceName, + queue: handlerName, connected: true, jobs: queueStats, workers: { @@ -141,6 +142,8 @@ export class MonitoringService { this.logger.warn(`Failed to get stats for queue ${handlerName}`, { error }); stats.push({ name: handlerName, + service: serviceName, + queue: handlerName, connected: false, jobs: { waiting: 0, diff --git a/apps/stock/web-api/src/types/monitoring.types.ts b/apps/stock/web-api/src/types/monitoring.types.ts index 6560050..d04edd3 100644 --- a/apps/stock/web-api/src/types/monitoring.types.ts +++ b/apps/stock/web-api/src/types/monitoring.types.ts @@ -23,6 +23,8 @@ export interface CacheStats { export interface QueueStats { name: string; + service: string; + queue: string; connected: boolean; jobs: { waiting: number; diff --git a/apps/stock/web-app/src/features/monitoring/components/QueueStatsTable.tsx b/apps/stock/web-app/src/features/monitoring/components/QueueStatsTable.tsx index ca3b1a8..cae7638 100644 --- a/apps/stock/web-app/src/features/monitoring/components/QueueStatsTable.tsx +++ b/apps/stock/web-app/src/features/monitoring/components/QueueStatsTable.tsx @@ -30,6 +30,7 @@ export function QueueStatsTable({ queues }: QueueStatsTableProps) { + @@ -46,7 +47,8 @@ export function QueueStatsTable({ queues }: QueueStatsTableProps) { {queues.map((queue) => ( - + +
Service Queue Status Waiting
{queue.name}{queue.service}{queue.queue}