removed configs from all libs and will inject them within the services themselves

This commit is contained in:
Boki 2025-06-18 14:50:47 -04:00
parent fd28162811
commit 6cc5b339bc
32 changed files with 366 additions and 349 deletions

View file

@ -25,7 +25,7 @@ export class RedisCache implements CacheProvider {
uptime: 0,
};
constructor(options: CacheOptions = {}) {
constructor(options: CacheOptions) {
this.defaultTTL = options.ttl ?? 3600; // 1 hour default
this.keyPrefix = options.keyPrefix ?? 'cache:';
this.enableMetrics = options.enableMetrics ?? true;
@ -46,6 +46,7 @@ export class RedisCache implements CacheProvider {
this.redis = this.connectionManager.getConnection({
name: `${baseName}-SERVICE`,
singleton: options.shared ?? true, // Default to shared connection for cache
redisConfig: options.redisConfig,
});
// Only setup event handlers for non-shared connections to avoid memory leaks