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 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 };
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue