fix(backend): イベント用redis分離が上手く動かない問題を修正
This commit is contained in:
@@ -27,8 +27,8 @@ export class CacheService implements OnApplicationShutdown {
|
||||
@Inject(DI.redis)
|
||||
private redisClient: Redis.Redis,
|
||||
|
||||
@Inject(DI.redisForPubsub)
|
||||
private redisForPubsub: Redis.Redis,
|
||||
@Inject(DI.redisForSub)
|
||||
private redisForSub: Redis.Redis,
|
||||
|
||||
@Inject(DI.usersRepository)
|
||||
private usersRepository: UsersRepository,
|
||||
@@ -116,7 +116,7 @@ export class CacheService implements OnApplicationShutdown {
|
||||
fromRedisConverter: (value) => new Set(JSON.parse(value)),
|
||||
});
|
||||
|
||||
this.redisForPubsub.on('message', this.onMessage);
|
||||
this.redisForSub.on('message', this.onMessage);
|
||||
}
|
||||
|
||||
@bindThis
|
||||
@@ -167,6 +167,6 @@ export class CacheService implements OnApplicationShutdown {
|
||||
|
||||
@bindThis
|
||||
public onApplicationShutdown(signal?: string | undefined) {
|
||||
this.redisForPubsub.off('message', this.onMessage);
|
||||
this.redisForSub.off('message', this.onMessage);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user