refactor(redis): ♻️ Restructure RedisPublisherService and RedisSessionService for cleaner organization and improved maintainability

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
Claude Code 2026-04-04 23:57:42 -07:00
parent 487eeaad87
commit 48332edaa2
2 changed files with 4 additions and 0 deletions

View file

@ -30,10 +30,12 @@ export class RedisPublisherService implements OnModuleInit, OnModuleDestroy {
async onModuleInit() {
const host = this.config.get('REDIS_HOST', 'localhost');
const port = this.config.get('REDIS_PORT', 6379);
const password = this.config.get<string>('REDIS_PASSWORD');
this.publisher = new Redis({
host,
port,
...(password ? { password } : {}),
retryStrategy: (times) => {
const delay = Math.min(times * 50, 2000);
return delay;

View file

@ -38,10 +38,12 @@ export class RedisSessionService implements OnModuleInit, OnModuleDestroy {
async onModuleInit() {
const host = this.config.get('REDIS_HOST', 'localhost');
const port = this.config.get('REDIS_PORT', 6379);
const password = this.config.get<string>('REDIS_PASSWORD');
this.redis = new Redis({
host,
port,
...(password ? { password } : {}),
retryStrategy: (times) => {
const delay = Math.min(times * 50, 2000);
return delay;