summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/UserCacheService.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/backend/src/core/UserCacheService.ts')
-rw-r--r--packages/backend/src/core/UserCacheService.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/backend/src/core/UserCacheService.ts b/packages/backend/src/core/UserCacheService.ts
index 29a64f5848..52cedbd105 100644
--- a/packages/backend/src/core/UserCacheService.ts
+++ b/packages/backend/src/core/UserCacheService.ts
@@ -45,10 +45,10 @@ export class UserCacheService implements OnApplicationShutdown {
case 'userChangeSuspendedState':
case 'remoteUserUpdated': {
const user = await this.usersRepository.findOneByOrFail({ id: body.id });
- this.userByIdCache.set(user.id, user);
+ this.userByIdCache.set(user.id, user as CacheableUser);
for (const [k, v] of this.uriPersonCache.cache.entries()) {
if (v.value?.id === user.id) {
- this.uriPersonCache.set(k, user);
+ this.uriPersonCache.set(k, user as CacheableUser);
}
}
if (this.userEntityService.isLocalUser(user)) {
@@ -78,7 +78,7 @@ export class UserCacheService implements OnApplicationShutdown {
@bindThis
public findById(userId: User['id']) {
- return this.userByIdCache.fetch(userId, () => this.usersRepository.findOneByOrFail({ id: userId }));
+ return this.userByIdCache.fetch(userId, () => this.usersRepository.findOneByOrFail({ id: userId }) as Promise<CacheableUser>);
}
@bindThis