mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-07 12:36:57 +00:00
update quantum caches when a user is deleted
This commit is contained in:
parent
9853a4f3bd
commit
3d13860ec8
1 changed files with 11 additions and 1 deletions
|
@ -138,7 +138,7 @@ export class CacheService implements OnApplicationShutdown {
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
private async onUserEvent<E extends 'userChangeSuspendedState' | 'userChangeDeletedState' | 'remoteUserUpdated' | 'localUserUpdated'>(body: InternalEventTypes[E]): Promise<void> {
|
private async onUserEvent<E extends 'userChangeSuspendedState' | 'userChangeDeletedState' | 'remoteUserUpdated' | 'localUserUpdated'>(body: InternalEventTypes[E], _: E, isLocal: boolean): Promise<void> {
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
@ -151,6 +151,16 @@ export class CacheService implements OnApplicationShutdown {
|
||||||
this.uriPersonCache.delete(k);
|
this.uriPersonCache.delete(k);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (isLocal) {
|
||||||
|
await Promise.all([
|
||||||
|
this.userProfileCache.delete(body.id),
|
||||||
|
this.userMutingsCache.delete(body.id),
|
||||||
|
this.userBlockingCache.delete(body.id),
|
||||||
|
this.userBlockedCache.delete(body.id),
|
||||||
|
this.renoteMutingsCache.delete(body.id),
|
||||||
|
this.userFollowingsCache.delete(body.id),
|
||||||
|
]);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.userByIdCache.set(user.id, user);
|
this.userByIdCache.set(user.id, user);
|
||||||
for (const [k, v] of this.uriPersonCache.entries) {
|
for (const [k, v] of this.uriPersonCache.entries) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue