huge refactor to remove depenencie hell and add typesafe container

This commit is contained in:
Boki 2025-06-24 09:37:51 -04:00
parent 28b9822d55
commit 843a7b9b9b
148 changed files with 3603 additions and 2378 deletions

View file

@ -44,9 +44,9 @@ export function registerApplicationServices(
enableMetrics: true,
logger,
});
const proxyManager = new ProxyManager(proxyCache, config.proxy, logger);
// Note: Initialization will be handled by the lifecycle manager
return proxyManager;
}).singleton(),
@ -60,7 +60,7 @@ export function registerApplicationServices(
// Queue Manager
if (config.queue?.enabled && config.redis.enabled) {
container.register({
queueManager: asFunction(({ logger }) => {
queueManager: asFunction(({ logger, handlerRegistry }) => {
const { SmartQueueManager } = require('@stock-bot/queue');
const queueConfig = {
serviceName: config.service?.serviceName || config.service?.name || 'unknown',
@ -79,7 +79,7 @@ export function registerApplicationServices(
delayWorkerStart: config.queue!.delayWorkerStart ?? false,
autoDiscoverHandlers: true,
};
return new SmartQueueManager(queueConfig, logger);
return new SmartQueueManager(queueConfig, handlerRegistry, logger);
}).singleton(),
});
} else {
@ -87,4 +87,4 @@ export function registerApplicationServices(
queueManager: asValue(null),
});
}
}
}