From cbc85eef3e5bc8032783e31da25e27a2ce1c20e7 Mon Sep 17 00:00:00 2001 From: tamaina Date: Mon, 14 Jul 2025 14:15:29 +0900 Subject: [PATCH] wip --- packages/backend/src/core/FanoutTimelineService.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/backend/src/core/FanoutTimelineService.ts b/packages/backend/src/core/FanoutTimelineService.ts index 24999bf4da..3d1f571066 100644 --- a/packages/backend/src/core/FanoutTimelineService.ts +++ b/packages/backend/src/core/FanoutTimelineService.ts @@ -8,6 +8,7 @@ import * as Redis from 'ioredis'; import { DI } from '@/di-symbols.js'; import { bindThis } from '@/decorators.js'; import { IdService } from '@/core/IdService.js'; +import { MiUser } from '@/models/User.js'; export type FanoutTimelineName = ( // home timeline @@ -112,4 +113,17 @@ export class FanoutTimelineService { public purge(name: FanoutTimelineName) { return this.redisForTimelines.del('list:' + name); } + + @bindThis + public purgeByUserIds(userIds: MiUser['id'][]) { + return Promise.all(userIds.flatMap(userId => [ + this.purge(`homeTimeline:${userId}`), + this.purge(`homeTimelineWithFiles:${userId}`), + this.purge(`localTimelineWithReplyTo:${userId}`), + this.purge(`userTimeline:${userId}`), + this.purge(`userTimelineWithFiles:${userId}`), + this.purge(`userTimelineWithReplies:${userId}`), + this.purge(`userTimelineWithChannel:${userId}`), + ])); + } }