diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2023-02-12 18:47:30 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2023-02-12 18:47:30 +0900 |
| commit | 451bc0b44483840da4b82394d077d07a35b5c71a (patch) | |
| tree | 703c3c880c238eaea8047300f5c8663a20c545e5 /packages/backend/src/core/UserCacheService.ts | |
| parent | Merge branch 'develop' of https://github.com/misskey-dev/misskey into develop (diff) | |
| download | sharkey-451bc0b44483840da4b82394d077d07a35b5c71a.tar.gz sharkey-451bc0b44483840da4b82394d077d07a35b5c71a.tar.bz2 sharkey-451bc0b44483840da4b82394d077d07a35b5c71a.zip | |
refactor: fix types
Diffstat (limited to 'packages/backend/src/core/UserCacheService.ts')
| -rw-r--r-- | packages/backend/src/core/UserCacheService.ts | 6 |
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 |