summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/UserCacheService.ts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2023-02-13 15:50:22 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2023-02-13 15:50:22 +0900
commit1b21bad202db9d30adc3f71d2ffa11b3b5187482 (patch)
tree89036a2bb0eeb9670f8b4ac50546b01414e200d5 /packages/backend/src/core/UserCacheService.ts
parentMerge branch 'develop' of https://github.com/misskey-dev/misskey into develop (diff)
downloadsharkey-1b21bad202db9d30adc3f71d2ffa11b3b5187482.tar.gz
sharkey-1b21bad202db9d30adc3f71d2ffa11b3b5187482.tar.bz2
sharkey-1b21bad202db9d30adc3f71d2ffa11b3b5187482.zip
refactor
Diffstat (limited to 'packages/backend/src/core/UserCacheService.ts')
-rw-r--r--packages/backend/src/core/UserCacheService.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/packages/backend/src/core/UserCacheService.ts b/packages/backend/src/core/UserCacheService.ts
index 5f0a919088..fc383d1c08 100644
--- a/packages/backend/src/core/UserCacheService.ts
+++ b/packages/backend/src/core/UserCacheService.ts
@@ -2,7 +2,7 @@ import { Inject, Injectable } from '@nestjs/common';
import Redis from 'ioredis';
import type { UsersRepository } from '@/models/index.js';
import { Cache } from '@/misc/cache.js';
-import type { ILocalUser, User } from '@/models/entities/User.js';
+import type { LocalUser, User } from '@/models/entities/User.js';
import { DI } from '@/di-symbols.js';
import { UserEntityService } from '@/core/entities/UserEntityService.js';
import { bindThis } from '@/decorators.js';
@@ -12,8 +12,8 @@ import type { OnApplicationShutdown } from '@nestjs/common';
@Injectable()
export class UserCacheService implements OnApplicationShutdown {
public userByIdCache: Cache<User>;
- public localUserByNativeTokenCache: Cache<ILocalUser | null>;
- public localUserByIdCache: Cache<ILocalUser>;
+ public localUserByNativeTokenCache: Cache<LocalUser | null>;
+ public localUserByIdCache: Cache<LocalUser>;
public uriPersonCache: Cache<User | null>;
constructor(
@@ -28,8 +28,8 @@ export class UserCacheService implements OnApplicationShutdown {
//this.onMessage = this.onMessage.bind(this);
this.userByIdCache = new Cache<User>(Infinity);
- this.localUserByNativeTokenCache = new Cache<ILocalUser | null>(Infinity);
- this.localUserByIdCache = new Cache<ILocalUser>(Infinity);
+ this.localUserByNativeTokenCache = new Cache<LocalUser | null>(Infinity);
+ this.localUserByIdCache = new Cache<LocalUser>(Infinity);
this.uriPersonCache = new Cache<User | null>(Infinity);
this.redisSubscriber.on('message', this.onMessage);
@@ -58,7 +58,7 @@ export class UserCacheService implements OnApplicationShutdown {
break;
}
case 'userTokenRegenerated': {
- const user = await this.usersRepository.findOneByOrFail({ id: body.id }) as ILocalUser;
+ const user = await this.usersRepository.findOneByOrFail({ id: body.id }) as LocalUser;
this.localUserByNativeTokenCache.delete(body.oldToken);
this.localUserByNativeTokenCache.set(body.newToken, user);
break;