fixed up workers
This commit is contained in:
parent
60d7de1da8
commit
f41622e530
5 changed files with 30 additions and 8 deletions
|
|
@ -76,13 +76,13 @@ export class MonitoringService {
|
||||||
const stats: QueueStats[] = [];
|
const stats: QueueStats[] = [];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (!this.container.queue) {
|
if (!this.container.queueManager) {
|
||||||
this.logger.warn('No queue manager available');
|
this.logger.warn('No queue manager available');
|
||||||
return stats;
|
return stats;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get all queue names from the SmartQueueManager
|
// Get all queue names from the QueueManager
|
||||||
const queueManager = this.container.queue as any;
|
const queueManager = this.container.queueManager as any;
|
||||||
this.logger.debug('Queue manager type:', {
|
this.logger.debug('Queue manager type:', {
|
||||||
type: queueManager.constructor.name,
|
type: queueManager.constructor.name,
|
||||||
hasGetAllQueues: typeof queueManager.getAllQueues === 'function',
|
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
|
// Always use the known queue names since web-api doesn't create worker queues
|
||||||
const handlerMapping = {
|
const handlerMapping = {
|
||||||
proxy: 'data-ingestion',
|
|
||||||
qm: 'data-ingestion',
|
qm: 'data-ingestion',
|
||||||
ib: 'data-ingestion',
|
ib: 'data-ingestion',
|
||||||
ceo: 'data-ingestion',
|
ceo: 'data-ingestion',
|
||||||
|
|
@ -127,6 +126,8 @@ export class MonitoringService {
|
||||||
|
|
||||||
stats.push({
|
stats.push({
|
||||||
name: handlerName,
|
name: handlerName,
|
||||||
|
service: serviceName,
|
||||||
|
queue: handlerName,
|
||||||
connected: true,
|
connected: true,
|
||||||
jobs: queueStats,
|
jobs: queueStats,
|
||||||
workers: {
|
workers: {
|
||||||
|
|
@ -141,6 +142,8 @@ export class MonitoringService {
|
||||||
this.logger.warn(`Failed to get stats for queue ${handlerName}`, { error });
|
this.logger.warn(`Failed to get stats for queue ${handlerName}`, { error });
|
||||||
stats.push({
|
stats.push({
|
||||||
name: handlerName,
|
name: handlerName,
|
||||||
|
service: serviceName,
|
||||||
|
queue: handlerName,
|
||||||
connected: false,
|
connected: false,
|
||||||
jobs: {
|
jobs: {
|
||||||
waiting: 0,
|
waiting: 0,
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,8 @@ export interface CacheStats {
|
||||||
|
|
||||||
export interface QueueStats {
|
export interface QueueStats {
|
||||||
name: string;
|
name: string;
|
||||||
|
service: string;
|
||||||
|
queue: string;
|
||||||
connected: boolean;
|
connected: boolean;
|
||||||
jobs: {
|
jobs: {
|
||||||
waiting: number;
|
waiting: number;
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ export function QueueStatsTable({ queues }: QueueStatsTableProps) {
|
||||||
<table className="w-full text-xs">
|
<table className="w-full text-xs">
|
||||||
<thead>
|
<thead>
|
||||||
<tr className="border-b border-border">
|
<tr className="border-b border-border">
|
||||||
|
<th className="text-left py-2 px-3 text-text-secondary font-medium">Service</th>
|
||||||
<th className="text-left py-2 px-3 text-text-secondary font-medium">Queue</th>
|
<th className="text-left py-2 px-3 text-text-secondary font-medium">Queue</th>
|
||||||
<th className="text-center py-2 px-3 text-text-secondary font-medium">Status</th>
|
<th className="text-center py-2 px-3 text-text-secondary font-medium">Status</th>
|
||||||
<th className="text-right py-2 px-3 text-text-secondary font-medium">Waiting</th>
|
<th className="text-right py-2 px-3 text-text-secondary font-medium">Waiting</th>
|
||||||
|
|
@ -46,7 +47,8 @@ export function QueueStatsTable({ queues }: QueueStatsTableProps) {
|
||||||
<tbody>
|
<tbody>
|
||||||
{queues.map((queue) => (
|
{queues.map((queue) => (
|
||||||
<tr key={queue.name} className="border-b border-border hover:bg-surface-tertiary/50 transition-colors">
|
<tr key={queue.name} className="border-b border-border hover:bg-surface-tertiary/50 transition-colors">
|
||||||
<td className="py-2 px-3 font-medium text-text-primary">{queue.name}</td>
|
<td className="py-2 px-3 font-medium text-text-primary">{queue.service}</td>
|
||||||
|
<td className="py-2 px-3 font-medium text-text-primary">{queue.queue}</td>
|
||||||
<td className="py-2 px-3 text-center">
|
<td className="py-2 px-3 text-center">
|
||||||
<span className={cn(
|
<span className={cn(
|
||||||
'inline-block w-2 h-2 rounded-full',
|
'inline-block w-2 h-2 rounded-full',
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,8 @@ export interface CacheStats {
|
||||||
|
|
||||||
export interface QueueStats {
|
export interface QueueStats {
|
||||||
name: string;
|
name: string;
|
||||||
|
service: string;
|
||||||
|
queue: string;
|
||||||
connected: boolean;
|
connected: boolean;
|
||||||
jobs: {
|
jobs: {
|
||||||
waiting: number;
|
waiting: number;
|
||||||
|
|
|
||||||
13
libs/core/cache/src/redis-cache.ts
vendored
13
libs/core/cache/src/redis-cache.ts
vendored
|
|
@ -305,9 +305,22 @@ export class RedisCache implements CacheProvider {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
this.updateStats(true);
|
this.updateStats(true);
|
||||||
|
|
||||||
|
try {
|
||||||
const parsed = JSON.parse(value);
|
const parsed = JSON.parse(value);
|
||||||
this.logger.debug('Cache raw get hit', { key });
|
this.logger.debug('Cache raw get hit', { key });
|
||||||
return parsed;
|
return parsed;
|
||||||
|
} catch (error) {
|
||||||
|
// If JSON parsing fails, log the error with more context
|
||||||
|
this.logger.warn('Cache getRaw JSON parse failed', {
|
||||||
|
key,
|
||||||
|
valueLength: value.length,
|
||||||
|
valuePreview: value.substring(0, 100),
|
||||||
|
error: error instanceof Error ? error.message : String(error)
|
||||||
|
});
|
||||||
|
// Return the raw value as-is if it can't be parsed
|
||||||
|
return value as unknown as T;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
null,
|
null,
|
||||||
'getRaw'
|
'getRaw'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue