diff options
| author | Hazelnoot <acomputerdog@gmail.com> | 2025-06-12 15:42:39 +0000 |
|---|---|---|
| committer | Hazelnoot <acomputerdog@gmail.com> | 2025-06-12 15:42:39 +0000 |
| commit | 55551a5a8a3a218b9f56491f2dbe3f70e3ef3556 (patch) | |
| tree | 927f789e18162a91da0144356d040995864613ee /packages/backend/src/core/UserBlockingService.ts | |
| parent | merge: Enforce DM visibility in generateVisibilityQuery (!1108) (diff) | |
| parent | fix relations in MastodonDataService.ts (diff) | |
| download | sharkey-55551a5a8a3a218b9f56491f2dbe3f70e3ef3556.tar.gz sharkey-55551a5a8a3a218b9f56491f2dbe3f70e3ef3556.tar.bz2 sharkey-55551a5a8a3a218b9f56491f2dbe3f70e3ef3556.zip | |
merge: Avoid more N+1 queries in NoteEntityService and UserEntityService (!1099)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1099
Approved-by: dakkar <dakkar@thenautilus.net>
Approved-by: Marie <github@yuugi.dev>
Diffstat (limited to 'packages/backend/src/core/UserBlockingService.ts')
| -rw-r--r-- | packages/backend/src/core/UserBlockingService.ts | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/packages/backend/src/core/UserBlockingService.ts b/packages/backend/src/core/UserBlockingService.ts index 8da1bb2092..1a1e7c4778 100644 --- a/packages/backend/src/core/UserBlockingService.ts +++ b/packages/backend/src/core/UserBlockingService.ts @@ -77,8 +77,10 @@ export class UserBlockingService implements OnModuleInit { await this.blockingsRepository.insert(blocking); - this.cacheService.userBlockingCache.refresh(blocker.id); - this.cacheService.userBlockedCache.refresh(blockee.id); + await Promise.all([ + this.cacheService.userBlockingCache.delete(blocker.id), + this.cacheService.userBlockedCache.delete(blockee.id), + ]); this.globalEventService.publishInternalEvent('blockingCreated', { blockerId: blocker.id, @@ -168,8 +170,10 @@ export class UserBlockingService implements OnModuleInit { await this.blockingsRepository.delete(blocking.id); - this.cacheService.userBlockingCache.refresh(blocker.id); - this.cacheService.userBlockedCache.refresh(blockee.id); + await Promise.all([ + this.cacheService.userBlockingCache.delete(blocker.id), + this.cacheService.userBlockedCache.delete(blockee.id), + ]); this.globalEventService.publishInternalEvent('blockingDeleted', { blockerId: blocker.id, |