This commit is contained in:
syuilo 2023-04-07 11:33:15 +09:00
parent 239d3f2dbf
commit 1e3fb5531b

View File

@ -27,8 +27,8 @@ export class CacheService implements OnApplicationShutdown {
@Inject(DI.redis) @Inject(DI.redis)
private redisClient: Redis.Redis, private redisClient: Redis.Redis,
@Inject(DI.redisSubscriber) @Inject(DI.redisForPubsub)
private redisSubscriber: Redis.Redis, private redisForPubsub: Redis.Redis,
@Inject(DI.usersRepository) @Inject(DI.usersRepository)
private usersRepository: UsersRepository, private usersRepository: UsersRepository,
@ -116,7 +116,7 @@ export class CacheService implements OnApplicationShutdown {
fromRedisConverter: (value) => new Set(JSON.parse(value)), fromRedisConverter: (value) => new Set(JSON.parse(value)),
}); });
this.redisSubscriber.on('message', this.onMessage); this.redisForPubsub.on('message', this.onMessage);
} }
@bindThis @bindThis
@ -167,6 +167,6 @@ export class CacheService implements OnApplicationShutdown {
@bindThis @bindThis
public onApplicationShutdown(signal?: string | undefined) { public onApplicationShutdown(signal?: string | undefined) {
this.redisSubscriber.off('message', this.onMessage); this.redisForPubsub.off('message', this.onMessage);
} }
} }