handler to auto register and removed service registry, cleaned up queues and cache naming

This commit is contained in:
Boki 2025-06-23 21:23:38 -04:00
parent 0d1be9e3cb
commit 34c6c36695
19 changed files with 474 additions and 198 deletions

View file

@ -30,10 +30,22 @@ export function registerApplicationServices(
// Proxy Manager
if (config.proxy && config.redis.enabled) {
container.register({
proxyManager: asFunction(({ cache, logger }) => {
if (!cache) {return null;}
proxyManager: asFunction(({ logger }) => {
// Create a separate cache instance for proxy with global prefix
const { createCache } = require('@stock-bot/cache');
const proxyCache = createCache({
redisConfig: {
host: config.redis.host,
port: config.redis.port,
password: config.redis.password,
db: 1, // Use cache DB (usually DB 1)
},
keyPrefix: 'cache:proxy:',
ttl: 86400, // 24 hours default
enableMetrics: true,
logger,
});
const proxyCache = new NamespacedCache(cache, 'proxy');
const proxyManager = new ProxyManager(proxyCache, config.proxy, logger);
// Note: Initialization will be handled by the lifecycle manager