removing deprecations

This commit is contained in:
Boki 2025-06-24 15:32:56 -04:00
parent fa67d666dc
commit f6038d385f
21 changed files with 91 additions and 158 deletions

View file

@ -1,4 +1,3 @@
import { getRandomUserAgent } from '@stock-bot/utils';
import type { CeoHandler } from '../ceo.handler';
@ -40,7 +39,7 @@ export async function processIndividualSymbol(
}
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 };

View file

@ -39,7 +39,11 @@ export async function processIndividualSymbol(
const spielCount = data.spiels.length;
if (spielCount === 0) {
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
}
const latestSpielTime = data.spiels[0]?.timestamp;
@ -77,7 +81,11 @@ export async function processIndividualSymbol(
}));
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}`);
await this.scheduleOperation(

View file

@ -32,7 +32,7 @@ export async function initializeAllHandlers(serviceContainer: IServiceContainer)
count: handlers.length,
handlers: handlers.map(h => (h as any).__handlerName || h.name),
});
// Log what metadata the handlers have
for (const HandlerClass of handlers) {
const metadata = (HandlerClass as any).__handlerMetadata;
@ -46,7 +46,7 @@ export async function initializeAllHandlers(serviceContainer: IServiceContainer)
// Get the DI container from the service container
const diContainer = (serviceContainer as any)._diContainer;
if (diContainer?.resolve) {
// Get handler scanner from DI container
const scanner = diContainer.resolve('handlerScanner');
@ -58,7 +58,7 @@ export async function initializeAllHandlers(serviceContainer: IServiceContainer)
} else {
logger.warn('Handler scanner not found or missing registerHandlerClass method');
}
// Also check the handler registry directly
const handlerRegistry = diContainer.resolve('handlerRegistry');
if (handlerRegistry) {

View file

@ -1,9 +1,4 @@
import {
BaseHandler,
Handler,
Operation,
ScheduledOperation,
} from '@stock-bot/handlers';
import { BaseHandler, Handler, Operation, ScheduledOperation } from '@stock-bot/handlers';
import type { IServiceContainer } from '@stock-bot/types';
import { clearPostgreSQLData } from './operations/clear-postgresql-data.operations';
import { getSyncStatus } from './operations/enhanced-sync-status.operations';

View file

@ -1,5 +1,5 @@
import type { IServiceContainer } from '@stock-bot/types';
import { getLogger } from '@stock-bot/logger';
import type { IServiceContainer } from '@stock-bot/types';
import type { JobPayload } from '../../../types/job-payloads';
const logger = getLogger('sync-qm-exchanges');

View file

@ -2,8 +2,8 @@
* Exchange management routes - Refactored
*/
import { Hono } from 'hono';
import type { IServiceContainer } from '@stock-bot/types';
import { getLogger } from '@stock-bot/logger';
import type { IServiceContainer } from '@stock-bot/types';
import { createExchangeService } from '../services/exchange.service';
import { createSuccessResponse, handleError } from '../utils/error-handler';
import {

View file

@ -1,5 +1,5 @@
import type { IServiceContainer } from '@stock-bot/types';
import { getLogger } from '@stock-bot/logger';
import type { IServiceContainer } from '@stock-bot/types';
import {
CreateExchangeRequest,
CreateProviderMappingRequest,

View file

@ -818,12 +818,12 @@ export class MonitoringService {
const workers = await bullQueue.getWorkers();
return workers.length;
}
// Fallback to getWorkersCount if available
if (bullQueue.getWorkersCount && typeof bullQueue.getWorkersCount === 'function') {
return await bullQueue.getWorkersCount();
}
return 0;
} catch (error) {
this.logger.debug('Failed to get active worker count from BullMQ', { error });