summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/CacheService.ts
diff options
context:
space:
mode:
authormisskey-release-bot[bot] <157398866+misskey-release-bot[bot]@users.noreply.github.com>2024-08-18 08:08:47 +0000
committerGitHub <noreply@github.com>2024-08-18 08:08:47 +0000
commit882c8b93c164f2841c88b58034ed58d2553a375c (patch)
treea624b844c36c6685755ece1e713febf863faedea /packages/backend/src/core/CacheService.ts
parentMerge pull request #14233 from misskey-dev/develop (diff)
parentRelease: 2024.8.0 (diff)
downloadsharkey-882c8b93c164f2841c88b58034ed58d2553a375c.tar.gz
sharkey-882c8b93c164f2841c88b58034ed58d2553a375c.tar.bz2
sharkey-882c8b93c164f2841c88b58034ed58d2553a375c.zip
Merge pull request #14391 from misskey-dev/develop
Release: 2024.8.0
Diffstat (limited to 'packages/backend/src/core/CacheService.ts')
-rw-r--r--packages/backend/src/core/CacheService.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/packages/backend/src/core/CacheService.ts b/packages/backend/src/core/CacheService.ts
index d008e7ec52..6725ebe75b 100644
--- a/packages/backend/src/core/CacheService.ts
+++ b/packages/backend/src/core/CacheService.ts
@@ -56,10 +56,10 @@ export class CacheService implements OnApplicationShutdown {
) {
//this.onMessage = this.onMessage.bind(this);
- this.userByIdCache = new MemoryKVCache<MiUser>(Infinity);
- this.localUserByNativeTokenCache = new MemoryKVCache<MiLocalUser | null>(Infinity);
- this.localUserByIdCache = new MemoryKVCache<MiLocalUser>(Infinity);
- this.uriPersonCache = new MemoryKVCache<MiUser | null>(Infinity);
+ this.userByIdCache = new MemoryKVCache<MiUser>(1000 * 60 * 5); // 5m
+ this.localUserByNativeTokenCache = new MemoryKVCache<MiLocalUser | null>(1000 * 60 * 5); // 5m
+ this.localUserByIdCache = new MemoryKVCache<MiLocalUser>(1000 * 60 * 5); // 5m
+ this.uriPersonCache = new MemoryKVCache<MiUser | null>(1000 * 60 * 5); // 5m
this.userProfileCache = new RedisKVCache<MiUserProfile>(this.redisClient, 'userProfile', {
lifetime: 1000 * 60 * 30, // 30m
@@ -135,14 +135,14 @@ export class CacheService implements OnApplicationShutdown {
if (user == null) {
this.userByIdCache.delete(body.id);
this.localUserByIdCache.delete(body.id);
- for (const [k, v] of this.uriPersonCache.cache.entries()) {
+ for (const [k, v] of this.uriPersonCache.entries) {
if (v.value?.id === body.id) {
this.uriPersonCache.delete(k);
}
}
} else {
this.userByIdCache.set(user.id, user);
- for (const [k, v] of this.uriPersonCache.cache.entries()) {
+ for (const [k, v] of this.uriPersonCache.entries) {
if (v.value?.id === user.id) {
this.uriPersonCache.set(k, user);
}