removing deprecations
This commit is contained in:
parent
fa67d666dc
commit
f6038d385f
21 changed files with 91 additions and 158 deletions
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
import { getRandomUserAgent } from '@stock-bot/utils';
|
import { getRandomUserAgent } from '@stock-bot/utils';
|
||||||
import type { CeoHandler } from '../ceo.handler';
|
import type { CeoHandler } from '../ceo.handler';
|
||||||
|
|
||||||
|
|
@ -40,7 +39,7 @@ export async function processIndividualSymbol(
|
||||||
}
|
}
|
||||||
|
|
||||||
this.logger.info(
|
this.logger.info(
|
||||||
`Successfully processed CEO symbol ${symbol} shorts and found ${shortCount} positions`,
|
`Successfully processed CEO symbol ${symbol} shorts and found ${shortCount} positions`
|
||||||
);
|
);
|
||||||
|
|
||||||
return { ceoId, shortCount, timestamp };
|
return { ceoId, shortCount, timestamp };
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,11 @@ export async function processIndividualSymbol(
|
||||||
const spielCount = data.spiels.length;
|
const spielCount = data.spiels.length;
|
||||||
if (spielCount === 0) {
|
if (spielCount === 0) {
|
||||||
this.logger.warn(`No spiels found for ceoId ${ceoId}`);
|
this.logger.warn(`No spiels found for ceoId ${ceoId}`);
|
||||||
await this.mongodb.updateMany('ceoChannels', { ceoId }, { $set: { lastSpielTime: timestamp, finished: true } });
|
await this.mongodb.updateMany(
|
||||||
|
'ceoChannels',
|
||||||
|
{ ceoId },
|
||||||
|
{ $set: { lastSpielTime: timestamp, finished: true } }
|
||||||
|
);
|
||||||
return null; // No data to process
|
return null; // No data to process
|
||||||
}
|
}
|
||||||
const latestSpielTime = data.spiels[0]?.timestamp;
|
const latestSpielTime = data.spiels[0]?.timestamp;
|
||||||
|
|
@ -77,7 +81,11 @@ export async function processIndividualSymbol(
|
||||||
}));
|
}));
|
||||||
|
|
||||||
await this.mongodb.batchUpsert('ceoPosts', posts, ['spielId']);
|
await this.mongodb.batchUpsert('ceoPosts', posts, ['spielId']);
|
||||||
await this.mongodb.updateMany('ceoChannels', { ceoId }, { $set: { lastSpielTime: latestSpielTime } });
|
await this.mongodb.updateMany(
|
||||||
|
'ceoChannels',
|
||||||
|
{ ceoId },
|
||||||
|
{ $set: { lastSpielTime: latestSpielTime } }
|
||||||
|
);
|
||||||
this.logger.info(`Fetched ${spielCount} spiels for ceoId ${ceoId}`);
|
this.logger.info(`Fetched ${spielCount} spiels for ceoId ${ceoId}`);
|
||||||
|
|
||||||
await this.scheduleOperation(
|
await this.scheduleOperation(
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,4 @@
|
||||||
import {
|
import { BaseHandler, Handler, Operation, ScheduledOperation } from '@stock-bot/handlers';
|
||||||
BaseHandler,
|
|
||||||
Handler,
|
|
||||||
Operation,
|
|
||||||
ScheduledOperation,
|
|
||||||
} from '@stock-bot/handlers';
|
|
||||||
import type { IServiceContainer } from '@stock-bot/types';
|
import type { IServiceContainer } from '@stock-bot/types';
|
||||||
import { clearPostgreSQLData } from './operations/clear-postgresql-data.operations';
|
import { clearPostgreSQLData } from './operations/clear-postgresql-data.operations';
|
||||||
import { getSyncStatus } from './operations/enhanced-sync-status.operations';
|
import { getSyncStatus } from './operations/enhanced-sync-status.operations';
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import type { IServiceContainer } from '@stock-bot/types';
|
|
||||||
import { getLogger } from '@stock-bot/logger';
|
import { getLogger } from '@stock-bot/logger';
|
||||||
|
import type { IServiceContainer } from '@stock-bot/types';
|
||||||
import type { JobPayload } from '../../../types/job-payloads';
|
import type { JobPayload } from '../../../types/job-payloads';
|
||||||
|
|
||||||
const logger = getLogger('sync-qm-exchanges');
|
const logger = getLogger('sync-qm-exchanges');
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
* Exchange management routes - Refactored
|
* Exchange management routes - Refactored
|
||||||
*/
|
*/
|
||||||
import { Hono } from 'hono';
|
import { Hono } from 'hono';
|
||||||
import type { IServiceContainer } from '@stock-bot/types';
|
|
||||||
import { getLogger } from '@stock-bot/logger';
|
import { getLogger } from '@stock-bot/logger';
|
||||||
|
import type { IServiceContainer } from '@stock-bot/types';
|
||||||
import { createExchangeService } from '../services/exchange.service';
|
import { createExchangeService } from '../services/exchange.service';
|
||||||
import { createSuccessResponse, handleError } from '../utils/error-handler';
|
import { createSuccessResponse, handleError } from '../utils/error-handler';
|
||||||
import {
|
import {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import type { IServiceContainer } from '@stock-bot/types';
|
|
||||||
import { getLogger } from '@stock-bot/logger';
|
import { getLogger } from '@stock-bot/logger';
|
||||||
|
import type { IServiceContainer } from '@stock-bot/types';
|
||||||
import {
|
import {
|
||||||
CreateExchangeRequest,
|
CreateExchangeRequest,
|
||||||
CreateProviderMappingRequest,
|
CreateProviderMappingRequest,
|
||||||
|
|
|
||||||
2
libs/core/cache/src/redis-cache.ts
vendored
2
libs/core/cache/src/redis-cache.ts
vendored
|
|
@ -316,7 +316,7 @@ export class RedisCache implements CacheProvider {
|
||||||
key,
|
key,
|
||||||
valueLength: value.length,
|
valueLength: value.length,
|
||||||
valuePreview: value.substring(0, 100),
|
valuePreview: value.substring(0, 100),
|
||||||
error: error instanceof Error ? error.message : String(error)
|
error: error instanceof Error ? error.message : String(error),
|
||||||
});
|
});
|
||||||
// Return the raw value as-is if it can't be parsed
|
// Return the raw value as-is if it can't be parsed
|
||||||
return value as unknown as T;
|
return value as unknown as T;
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ import { join } from 'path';
|
||||||
import { parseArgs } from 'util';
|
import { parseArgs } from 'util';
|
||||||
import { redactSecrets } from './utils/secrets';
|
import { redactSecrets } from './utils/secrets';
|
||||||
import {
|
import {
|
||||||
checkDeprecations,
|
|
||||||
checkRequiredEnvVars,
|
checkRequiredEnvVars,
|
||||||
formatValidationResult,
|
formatValidationResult,
|
||||||
validateCompleteness,
|
validateCompleteness,
|
||||||
|
|
@ -24,11 +23,6 @@ interface CliOptions {
|
||||||
help?: boolean;
|
help?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const DEPRECATIONS = {
|
|
||||||
'service.legacyMode': 'Use service.mode instead',
|
|
||||||
'database.redis': 'Use database.dragonfly instead',
|
|
||||||
};
|
|
||||||
|
|
||||||
const REQUIRED_PATHS = [
|
const REQUIRED_PATHS = [
|
||||||
'service.name',
|
'service.name',
|
||||||
'service.port',
|
'service.port',
|
||||||
|
|
@ -149,18 +143,6 @@ async function main() {
|
||||||
console.log(formatValidationResult(pathResult));
|
console.log(formatValidationResult(pathResult));
|
||||||
console.log();
|
console.log();
|
||||||
|
|
||||||
// Deprecations
|
|
||||||
console.log('4. Deprecation Warnings:');
|
|
||||||
const warnings = checkDeprecations(config, DEPRECATIONS);
|
|
||||||
if (warnings && warnings.length > 0) {
|
|
||||||
for (const warning of warnings) {
|
|
||||||
console.log(` ⚠️ ${warning.path}: ${warning.message}`);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
console.log(' ✅ No deprecated options found');
|
|
||||||
}
|
|
||||||
console.log();
|
|
||||||
|
|
||||||
// Overall result
|
// Overall result
|
||||||
const allValid = schemaResult.valid && envResult.valid && pathResult.valid;
|
const allValid = schemaResult.valid && envResult.valid && pathResult.valid;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,40 +37,6 @@ export function validateConfig<T>(config: unknown, schema: z.ZodSchema<T>): Vali
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Check for deprecated configuration options
|
|
||||||
*/
|
|
||||||
export function checkDeprecations(
|
|
||||||
config: Record<string, unknown>,
|
|
||||||
deprecations: Record<string, string>
|
|
||||||
): ValidationResult['warnings'] {
|
|
||||||
const warnings: ValidationResult['warnings'] = [];
|
|
||||||
|
|
||||||
function checkObject(obj: Record<string, unknown>, path: string[] = []): void {
|
|
||||||
for (const [key, value] of Object.entries(obj)) {
|
|
||||||
const currentPath = [...path, key];
|
|
||||||
const pathStr = currentPath.join('.');
|
|
||||||
|
|
||||||
if (pathStr in deprecations) {
|
|
||||||
const deprecationMessage = deprecations[pathStr];
|
|
||||||
if (deprecationMessage) {
|
|
||||||
warnings?.push({
|
|
||||||
path: pathStr,
|
|
||||||
message: deprecationMessage,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (value && typeof value === 'object' && !Array.isArray(value)) {
|
|
||||||
checkObject(value as Record<string, unknown>, currentPath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
checkObject(config);
|
|
||||||
return warnings;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check for required environment variables
|
* Check for required environment variables
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import type { MongoDBClient } from '@stock-bot/mongodb';
|
||||||
import type { PostgreSQLClient } from '@stock-bot/postgres';
|
import type { PostgreSQLClient } from '@stock-bot/postgres';
|
||||||
import type { ProxyManager } from '@stock-bot/proxy';
|
import type { ProxyManager } from '@stock-bot/proxy';
|
||||||
import type { QuestDBClient } from '@stock-bot/questdb';
|
import type { QuestDBClient } from '@stock-bot/questdb';
|
||||||
import type { SmartQueueManager } from '@stock-bot/queue';
|
import type { QueueManager } from '@stock-bot/queue';
|
||||||
import type { IServiceContainer } from '@stock-bot/types';
|
import type { IServiceContainer } from '@stock-bot/types';
|
||||||
import type { AppConfig } from '../config/schemas';
|
import type { AppConfig } from '../config/schemas';
|
||||||
import type { HandlerScanner } from '../scanner';
|
import type { HandlerScanner } from '../scanner';
|
||||||
|
|
@ -25,7 +25,7 @@ export interface ServiceDefinitions {
|
||||||
globalCache: CacheProvider | null;
|
globalCache: CacheProvider | null;
|
||||||
proxyManager: ProxyManager | null;
|
proxyManager: ProxyManager | null;
|
||||||
browser: Browser;
|
browser: Browser;
|
||||||
queueManager: SmartQueueManager | null;
|
queueManager: QueueManager | null;
|
||||||
|
|
||||||
// Database clients
|
// Database clients
|
||||||
mongoClient: MongoDBClient | null;
|
mongoClient: MongoDBClient | null;
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ export function registerApplicationServices(
|
||||||
if (config.queue?.enabled && config.redis.enabled) {
|
if (config.queue?.enabled && config.redis.enabled) {
|
||||||
container.register({
|
container.register({
|
||||||
queueManager: asFunction(({ logger, handlerRegistry }) => {
|
queueManager: asFunction(({ logger, handlerRegistry }) => {
|
||||||
const { SmartQueueManager } = require('@stock-bot/queue');
|
const { QueueManager } = require('@stock-bot/queue');
|
||||||
const queueConfig = {
|
const queueConfig = {
|
||||||
serviceName: config.service?.serviceName || config.service?.name || 'unknown',
|
serviceName: config.service?.serviceName || config.service?.name || 'unknown',
|
||||||
redis: {
|
redis: {
|
||||||
|
|
@ -79,7 +79,7 @@ export function registerApplicationServices(
|
||||||
delayWorkerStart: config.queue!.delayWorkerStart ?? true, // Changed to true so ServiceApplication can start workers
|
delayWorkerStart: config.queue!.delayWorkerStart ?? true, // Changed to true so ServiceApplication can start workers
|
||||||
autoDiscoverHandlers: true,
|
autoDiscoverHandlers: true,
|
||||||
};
|
};
|
||||||
return new SmartQueueManager(queueConfig, handlerRegistry, logger);
|
return new QueueManager(queueConfig, handlerRegistry, logger);
|
||||||
}).singleton(),
|
}).singleton(),
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
* Discovers and registers handlers with the DI container
|
* Discovers and registers handlers with the DI container
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { asClass, asFunction, type AwilixContainer } from 'awilix';
|
import { asFunction, type AwilixContainer } from 'awilix';
|
||||||
import { glob } from 'glob';
|
import { glob } from 'glob';
|
||||||
import type {
|
import type {
|
||||||
HandlerConfiguration,
|
HandlerConfiguration,
|
||||||
|
|
@ -82,7 +82,7 @@ export class HandlerScanner {
|
||||||
* Check if an exported value is a handler
|
* Check if an exported value is a handler
|
||||||
*/
|
*/
|
||||||
private isHandler(exported: any): boolean {
|
private isHandler(exported: any): boolean {
|
||||||
if (typeof exported !== 'function') return false;
|
if (typeof exported !== 'function') {return false;}
|
||||||
|
|
||||||
// Check for handler metadata added by decorators
|
// Check for handler metadata added by decorators
|
||||||
const hasHandlerName = !!(exported as any).__handlerName;
|
const hasHandlerName = !!(exported as any).__handlerName;
|
||||||
|
|
|
||||||
|
|
@ -3,16 +3,16 @@
|
||||||
* Encapsulates common patterns for Hono-based microservices
|
* Encapsulates common patterns for Hono-based microservices
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import type { AwilixContainer } from 'awilix';
|
||||||
import { Hono } from 'hono';
|
import { Hono } from 'hono';
|
||||||
import { cors } from 'hono/cors';
|
import { cors } from 'hono/cors';
|
||||||
import type { BaseAppConfig, UnifiedAppConfig } from '@stock-bot/config';
|
import type { BaseAppConfig, UnifiedAppConfig } from '@stock-bot/config';
|
||||||
import { toUnifiedConfig } from '@stock-bot/config';
|
import { toUnifiedConfig } from '@stock-bot/config';
|
||||||
|
import type { HandlerRegistry } from '@stock-bot/handler-registry';
|
||||||
import { getLogger, setLoggerConfig, shutdownLoggers, type Logger } from '@stock-bot/logger';
|
import { getLogger, setLoggerConfig, shutdownLoggers, type Logger } from '@stock-bot/logger';
|
||||||
import { Shutdown } from '@stock-bot/shutdown';
|
import { Shutdown } from '@stock-bot/shutdown';
|
||||||
import type { IServiceContainer } from '@stock-bot/types';
|
import type { IServiceContainer } from '@stock-bot/types';
|
||||||
import type { HandlerRegistry } from '@stock-bot/handler-registry';
|
|
||||||
import type { ServiceDefinitions } from './container/types';
|
import type { ServiceDefinitions } from './container/types';
|
||||||
import type { AwilixContainer } from 'awilix';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configuration for ServiceApplication
|
* Configuration for ServiceApplication
|
||||||
|
|
@ -280,7 +280,7 @@ export class ServiceApplication {
|
||||||
this.logger.debug('Initializing handlers...');
|
this.logger.debug('Initializing handlers...');
|
||||||
// Pass the service container with the DI container attached
|
// Pass the service container with the DI container attached
|
||||||
const containerWithDI = Object.assign({}, this.serviceContainer, {
|
const containerWithDI = Object.assign({}, this.serviceContainer, {
|
||||||
_diContainer: this.container
|
_diContainer: this.container,
|
||||||
});
|
});
|
||||||
await handlerInitializer(containerWithDI);
|
await handlerInitializer(containerWithDI);
|
||||||
this.logger.info('Handlers initialized');
|
this.logger.info('Handlers initialized');
|
||||||
|
|
@ -340,7 +340,9 @@ export class ServiceApplication {
|
||||||
const handlerRegistry = this.container.resolve<HandlerRegistry>('handlerRegistry');
|
const handlerRegistry = this.container.resolve<HandlerRegistry>('handlerRegistry');
|
||||||
const allHandlers = handlerRegistry.getAllHandlersWithSchedule();
|
const allHandlers = handlerRegistry.getAllHandlersWithSchedule();
|
||||||
|
|
||||||
this.logger.info(`Found ${allHandlers.size} handlers with scheduled jobs: ${Array.from(allHandlers.keys()).join(', ')}`);
|
this.logger.info(
|
||||||
|
`Found ${allHandlers.size} handlers with scheduled jobs: ${Array.from(allHandlers.keys()).join(', ')}`
|
||||||
|
);
|
||||||
|
|
||||||
let totalScheduledJobs = 0;
|
let totalScheduledJobs = 0;
|
||||||
for (const [handlerName, config] of allHandlers) {
|
for (const [handlerName, config] of allHandlers) {
|
||||||
|
|
@ -370,7 +372,7 @@ export class ServiceApplication {
|
||||||
});
|
});
|
||||||
|
|
||||||
const queue = queueManager.getQueue(handlerName, {
|
const queue = queueManager.getQueue(handlerName, {
|
||||||
handlerRegistry: handlerRegistry
|
handlerRegistry: handlerRegistry,
|
||||||
});
|
});
|
||||||
|
|
||||||
for (const scheduledJob of config.scheduledJobs) {
|
for (const scheduledJob of config.scheduledJobs) {
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,7 @@ import type { JobHandler, ScheduledJob } from '@stock-bot/types';
|
||||||
import type {
|
import type {
|
||||||
HandlerConfiguration,
|
HandlerConfiguration,
|
||||||
HandlerMetadata,
|
HandlerMetadata,
|
||||||
OperationMetadata,
|
|
||||||
RegistryStats,
|
RegistryStats,
|
||||||
ScheduleMetadata,
|
|
||||||
} from './types';
|
} from './types';
|
||||||
|
|
||||||
export class HandlerRegistry {
|
export class HandlerRegistry {
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import type { Collection } from 'mongodb';
|
||||||
import { createNamespacedCache } from '@stock-bot/cache';
|
import { createNamespacedCache } from '@stock-bot/cache';
|
||||||
import { getLogger } from '@stock-bot/logger';
|
import { getLogger } from '@stock-bot/logger';
|
||||||
import type {
|
import type {
|
||||||
|
|
@ -10,7 +11,6 @@ import type {
|
||||||
ServiceTypes,
|
ServiceTypes,
|
||||||
} from '@stock-bot/types';
|
} from '@stock-bot/types';
|
||||||
import { fetch } from '@stock-bot/utils';
|
import { fetch } from '@stock-bot/utils';
|
||||||
import type { Collection } from 'mongodb';
|
|
||||||
// Handler registry is now injected, not imported
|
// Handler registry is now injected, not imported
|
||||||
import { createJobHandler } from '../utils/create-job-handler';
|
import { createJobHandler } from '../utils/create-job-handler';
|
||||||
|
|
||||||
|
|
@ -336,7 +336,7 @@ export abstract class BaseHandler implements IHandler {
|
||||||
static extractMetadata(): HandlerMetadata | null {
|
static extractMetadata(): HandlerMetadata | null {
|
||||||
const constructor = this as any;
|
const constructor = this as any;
|
||||||
const handlerName = constructor.__handlerName;
|
const handlerName = constructor.__handlerName;
|
||||||
if (!handlerName){
|
if (!handlerName) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
// Core exports
|
// Core exports
|
||||||
export { Queue } from './queue';
|
export { Queue } from './queue';
|
||||||
export { QueueManager } from './queue-manager';
|
export { QueueManager } from './queue-manager';
|
||||||
export { SmartQueueManager } from './smart-queue-manager';
|
|
||||||
export { ServiceCache, createServiceCache } from './service-cache';
|
export { ServiceCache, createServiceCache } from './service-cache';
|
||||||
// Service utilities
|
// Service utilities
|
||||||
export {
|
export {
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,7 @@ export class QueueManager {
|
||||||
// For own service queues, include handler registry
|
// For own service queues, include handler registry
|
||||||
options = {
|
options = {
|
||||||
...options,
|
...options,
|
||||||
handlerRegistry: this.handlerRegistry
|
handlerRegistry: this.handlerRegistry,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -488,7 +488,9 @@ export class QueueManager {
|
||||||
let workersStarted = 0;
|
let workersStarted = 0;
|
||||||
const queues = this.queues;
|
const queues = this.queues;
|
||||||
|
|
||||||
this.logger.info(`Starting workers for ${queues.size} queues: ${Array.from(queues.keys()).join(', ')} (service: ${this.serviceName})`);
|
this.logger.info(
|
||||||
|
`Starting workers for ${queues.size} queues: ${Array.from(queues.keys()).join(', ')} (service: ${this.serviceName})`
|
||||||
|
);
|
||||||
|
|
||||||
for (const [queueName, queue] of queues) {
|
for (const [queueName, queue] of queues) {
|
||||||
// If we have a service name, check if this queue belongs to us
|
// If we have a service name, check if this queue belongs to us
|
||||||
|
|
|
||||||
|
|
@ -459,7 +459,7 @@ export class Queue {
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.error('Failed to get active workers', {
|
this.logger.error('Failed to get active workers', {
|
||||||
queueName: this.queueName,
|
queueName: this.queueName,
|
||||||
error
|
error,
|
||||||
});
|
});
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
@ -475,7 +475,7 @@ export class Queue {
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.error('Failed to get active worker count', {
|
this.logger.error('Failed to get active worker count', {
|
||||||
queueName: this.queueName,
|
queueName: this.queueName,
|
||||||
error
|
error,
|
||||||
});
|
});
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
@ -484,14 +484,16 @@ export class Queue {
|
||||||
/**
|
/**
|
||||||
* Get detailed worker information
|
* Get detailed worker information
|
||||||
*/
|
*/
|
||||||
async getWorkerDetails(): Promise<Array<{
|
async getWorkerDetails(): Promise<
|
||||||
id: string;
|
Array<{
|
||||||
name?: string;
|
id: string;
|
||||||
addr?: string;
|
name?: string;
|
||||||
age?: number;
|
addr?: string;
|
||||||
idle?: number;
|
age?: number;
|
||||||
started?: number;
|
idle?: number;
|
||||||
}>> {
|
started?: number;
|
||||||
|
}>
|
||||||
|
> {
|
||||||
try {
|
try {
|
||||||
const workers = await this.bullQueue.getWorkers();
|
const workers = await this.bullQueue.getWorkers();
|
||||||
return workers.map(worker => ({
|
return workers.map(worker => ({
|
||||||
|
|
@ -505,11 +507,9 @@ export class Queue {
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.error('Failed to get worker details', {
|
this.logger.error('Failed to get worker details', {
|
||||||
queueName: this.queueName,
|
queueName: this.queueName,
|
||||||
error
|
error,
|
||||||
});
|
});
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
// SmartQueueManager has been merged into QueueManager
|
|
||||||
// This file is kept for backward compatibility
|
|
||||||
|
|
||||||
import { QueueManager } from './queue-manager';
|
|
||||||
import type { SmartQueueConfig } from './types';
|
|
||||||
import type { HandlerRegistry } from '@stock-bot/handler-registry';
|
|
||||||
import type { Logger } from '@stock-bot/logger';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Use QueueManager directly with serviceName config
|
|
||||||
* SmartQueueManager functionality has been merged into QueueManager
|
|
||||||
*/
|
|
||||||
export class SmartQueueManager extends QueueManager {
|
|
||||||
constructor(config: SmartQueueConfig, handlerRegistry?: HandlerRegistry, logger?: Logger) {
|
|
||||||
// SmartQueueConfig already has serviceName, just pass it to QueueManager
|
|
||||||
super(config, handlerRegistry, logger);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue