fixed libs ready for new data-injection

This commit is contained in:
Boki 2025-06-21 20:38:16 -04:00
parent c5a114d544
commit 8405f44bd9
25 changed files with 277 additions and 241 deletions

View file

@ -7,7 +7,7 @@ import {
handlerRegistry,
type HandlerConfigWithSchedule,
} from '@stock-bot/queue';
import type { ServiceContainer } from '@stock-bot/connection-factory';
import type { ServiceContainer } from '@stock-bot/di';
const logger = getLogger('ib-provider');

View file

@ -2,7 +2,7 @@
* IB Exchanges Operations - Fetching exchange data from IB API
*/
import { OperationContext } from '@stock-bot/di';
import type { ServiceContainer } from '@stock-bot/connection-factory';
import type { ServiceContainer } from '@stock-bot/di';
import { IB_CONFIG } from '../shared/config';

View file

@ -2,7 +2,7 @@
* IB Symbols Operations - Fetching symbol data from IB API
*/
import { OperationContext } from '@stock-bot/di';
import type { ServiceContainer } from '@stock-bot/connection-factory';
import type { ServiceContainer } from '@stock-bot/di';
import { IB_CONFIG } from '../shared/config';

View file

@ -1,6 +0,0 @@
/**
* Proxy Manager - Simplified without stats tracking
*/
// This file is kept for compatibility but ProxyStatsManager has been removed
// All proxy management is now handled by the global ProxyManager in @stock-bot/utils

View file

@ -3,7 +3,7 @@
*/
import { OperationContext } from '@stock-bot/di';
import type { ServiceContainer } from '@stock-bot/connection-factory';
import type { ServiceContainer } from '@stock-bot/di';
import { initializeQMResources } from './session.operations';

View file

@ -7,7 +7,7 @@ import { QueueManager } from '@stock-bot/queue';
import { QMSessionManager } from '../shared/session-manager';
import { QM_SESSION_IDS } from '../shared/config';
import type { ServiceContainer } from '@stock-bot/connection-factory';
import type { ServiceContainer } from '@stock-bot/di';
import type { SymbolSpiderJob, SpiderResult } from '../shared/types';
import { initializeQMResources } from './session.operations';
import { searchQMSymbolsAPI } from './symbols.operations';

View file

@ -3,11 +3,10 @@ import {
Handler,
Operation,
QueueSchedule,
handlerRegistry,
createJobHandler,
type ExecutionContext,
type HandlerConfigWithSchedule
} from '@stock-bot/handlers';
import { handlerRegistry, createJobHandler } from '@stock-bot/types';
import type { IDataIngestionServices, IExecutionContext } from '@stock-bot/di';
import type { SymbolSpiderJob } from './shared/types';
@ -87,25 +86,26 @@ export class QMHandler extends BaseHandler {
async spiderSymbolSearch(payload: SymbolSpiderJob, context: ExecutionContext): Promise<unknown> {
this.logger.info('Starting QM spider symbol search', { payload });
// Direct access to typed dependencies
const spiderCollection = this.mongodb.collection('qm_spider_results');
// Store spider job info
// Store spider job info in cache (temporary data)
const spiderJobId = `spider:qm:${Date.now()}:${Math.random().toString(36).substr(2, 9)}`;
const spiderResult = {
payload,
startTime: new Date(),
status: 'started'
startTime: new Date().toISOString(),
status: 'started',
jobId: spiderJobId
};
await spiderCollection.insertOne(spiderResult);
// Store in cache with 1 hour TTL (temporary data)
await this.cache.set(spiderJobId, spiderResult, 3600);
this.logger.debug('Spider job stored in cache', { spiderJobId, ttl: 3600 });
// Schedule follow-up processing if needed
await this.scheduleOperation('search-symbols', { source: 'spider' }, 5000);
await this.scheduleOperation('search-symbols', { source: 'spider', spiderJobId }, 5000);
return {
success: true,
message: 'QM spider search initiated',
spiderJobId: spiderResult._id
spiderJobId
};
}
}

View file

@ -17,7 +17,7 @@ import {
disposeDataIngestionServices,
type IDataIngestionServices
} from '@stock-bot/di';
import { handlerRegistry } from '@stock-bot/handlers';
import { handlerRegistry } from '@stock-bot/types';
// Local imports
import { createRoutes } from './routes/create-routes';