mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-19 17:00:30 +00:00
Make BaseRedisRepository extend EventEmitter; make RedisShuttleRepository extend BaseRedisRepository
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import { createClient, RedisClientType } from 'redis';
|
||||
import { REDIS_RECONNECT_INTERVAL } from "../environment";
|
||||
import { EventEmitter } from 'stream';
|
||||
|
||||
export abstract class BaseRedisRepository {
|
||||
export abstract class BaseRedisRepository extends EventEmitter {
|
||||
protected redisClient;
|
||||
|
||||
constructor(
|
||||
@@ -14,6 +15,7 @@ export abstract class BaseRedisRepository {
|
||||
},
|
||||
}),
|
||||
) {
|
||||
super();
|
||||
this.redisClient = redisClient;
|
||||
this.redisClient.on('error', (err) => {
|
||||
console.error(err.stack);
|
||||
|
||||
Reference in New Issue
Block a user