fix(backend): ロールタイムラインのFTLが正しいRedisサーバーに保存されない問題を修正 (MisskeyIO#237)

This commit is contained in:
まっちゃとーにゅ 2023-11-20 09:11:37 +09:00 committed by GitHub
parent 600e4fab2e
commit c1e0647c75
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -88,12 +88,12 @@ export class RoleService implements OnApplicationShutdown {
private roleAssignmentByUserIdCache: MemoryKVCache<MiRoleAssignment[]>; private roleAssignmentByUserIdCache: MemoryKVCache<MiRoleAssignment[]>;
constructor( constructor(
@Inject(DI.redis)
private redisClient: Redis.Redis,
@Inject(DI.redisForSub) @Inject(DI.redisForSub)
private redisForSub: Redis.Redis, private redisForSub: Redis.Redis,
@Inject(DI.redisForTimelines)
private redisForTimelines: Redis.Redis,
@Inject(DI.usersRepository) @Inject(DI.usersRepository)
private usersRepository: UsersRepository, private usersRepository: UsersRepository,
@ -493,7 +493,7 @@ export class RoleService implements OnApplicationShutdown {
public async addNoteToRoleTimeline(note: Packed<'Note'>): Promise<void> { public async addNoteToRoleTimeline(note: Packed<'Note'>): Promise<void> {
const roles = await this.getUserRoles(note.userId); const roles = await this.getUserRoles(note.userId);
const redisPipeline = this.redisClient.pipeline(); const redisPipeline = this.redisForTimelines.pipeline();
for (const role of roles) { for (const role of roles) {
this.funoutTimelineService.push(`roleTimeline:${role.id}`, note.id, 1000, redisPipeline); this.funoutTimelineService.push(`roleTimeline:${role.id}`, note.id, 1000, redisPipeline);