feat(backend): イベント用Redisを別サーバーに分離できるように
This commit is contained in:
parent
f4588f3907
commit
ff6d9d2860
15 changed files with 98 additions and 51 deletions
|
@ -27,8 +27,8 @@ export class AntennaService implements OnApplicationShutdown {
|
|||
@Inject(DI.redis)
|
||||
private redisClient: Redis.Redis,
|
||||
|
||||
@Inject(DI.redisSubscriber)
|
||||
private redisSubscriber: Redis.Redis,
|
||||
@Inject(DI.redisForPubsub)
|
||||
private redisForPubsub: Redis.Redis,
|
||||
|
||||
@Inject(DI.mutingsRepository)
|
||||
private mutingsRepository: MutingsRepository,
|
||||
|
@ -52,12 +52,12 @@ export class AntennaService implements OnApplicationShutdown {
|
|||
this.antennasFetched = false;
|
||||
this.antennas = [];
|
||||
|
||||
this.redisSubscriber.on('message', this.onRedisMessage);
|
||||
this.redisForPubsub.on('message', this.onRedisMessage);
|
||||
}
|
||||
|
||||
@bindThis
|
||||
public onApplicationShutdown(signal?: string | undefined) {
|
||||
this.redisSubscriber.off('message', this.onRedisMessage);
|
||||
this.redisForPubsub.off('message', this.onRedisMessage);
|
||||
}
|
||||
|
||||
@bindThis
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue