A social knowledge tool for researchers built on ATProto

refactor: remove singleton pattern from RedisFactory

Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) <aider@aider.chat>

+8 -12
+8 -12
src/shared/infrastructure/redis/RedisFactory.ts
··· 1 1 import Redis from 'ioredis'; 2 2 3 3 export class RedisFactory { 4 - private static instance: Redis | null = null; 5 4 static createConnection(redisConfig: { 6 5 host: string; 7 6 port: number; 8 7 password?: string; 9 8 maxRetriesPerRequest: number | null; 10 9 }): Redis { 11 - if (!this.instance) { 12 - this.instance = new Redis({ 13 - host: redisConfig.host, 14 - port: redisConfig.port, 15 - password: redisConfig.password, 16 - maxRetriesPerRequest: redisConfig.maxRetriesPerRequest, 17 - username: 'default', 18 - family: 6, 19 - }); 20 - } 21 - return this.instance; 10 + return new Redis({ 11 + host: redisConfig.host, 12 + port: redisConfig.port, 13 + password: redisConfig.password, 14 + maxRetriesPerRequest: redisConfig.maxRetriesPerRequest, 15 + username: 'default', 16 + family: 6, 17 + }); 22 18 } 23 19 }