wip
This commit is contained in:
parent
3a5870b9a5
commit
cbc85eef3e
|
@ -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}`),
|
||||
]));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue