diff options
| author | Acid Chicken (硫酸鶏) <root@acid-chicken.com> | 2023-04-05 00:41:49 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-05 00:41:49 +0900 |
| commit | 7bd0001e763a12c2b2aeb5cf4417f802cd4fbb4c (patch) | |
| tree | 62ca232417372612f78761f26669b56a80d35733 /packages/backend/src/core/NoteCreateService.ts | |
| parent | Merge branch 'develop' into fix/visibility-widening (diff) | |
| parent | enhance(backend): improve cache (diff) | |
| download | sharkey-7bd0001e763a12c2b2aeb5cf4417f802cd4fbb4c.tar.gz sharkey-7bd0001e763a12c2b2aeb5cf4417f802cd4fbb4c.tar.bz2 sharkey-7bd0001e763a12c2b2aeb5cf4417f802cd4fbb4c.zip | |
Merge branch 'develop' into fix/visibility-widening
Diffstat (limited to 'packages/backend/src/core/NoteCreateService.ts')
| -rw-r--r-- | packages/backend/src/core/NoteCreateService.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/backend/src/core/NoteCreateService.ts b/packages/backend/src/core/NoteCreateService.ts index 7af7099432..83290b310e 100644 --- a/packages/backend/src/core/NoteCreateService.ts +++ b/packages/backend/src/core/NoteCreateService.ts @@ -20,7 +20,7 @@ import { isDuplicateKeyValueError } from '@/misc/is-duplicate-key-value-error.js import { checkWordMute } from '@/misc/check-word-mute.js'; import type { Channel } from '@/models/entities/Channel.js'; import { normalizeForSearch } from '@/misc/normalize-for-search.js'; -import { KVCache } from '@/misc/cache.js'; +import { MemoryCache } from '@/misc/cache.js'; import type { UserProfile } from '@/models/entities/UserProfile.js'; import { RelayService } from '@/core/RelayService.js'; import { FederatedInstanceService } from '@/core/FederatedInstanceService.js'; @@ -47,7 +47,7 @@ import { DB_MAX_NOTE_TEXT_LENGTH } from '@/const.js'; import { RoleService } from '@/core/RoleService.js'; import { MetaService } from '@/core/MetaService.js'; -const mutedWordsCache = new KVCache<{ userId: UserProfile['userId']; mutedWords: UserProfile['mutedWords']; }[]>(1000 * 60 * 5); +const mutedWordsCache = new MemoryCache<{ userId: UserProfile['userId']; mutedWords: UserProfile['mutedWords']; }[]>(1000 * 60 * 5); type NotificationType = 'reply' | 'renote' | 'quote' | 'mention'; @@ -473,7 +473,7 @@ export class NoteCreateService implements OnApplicationShutdown { this.incNotesCountOfUser(user); // Word mute - mutedWordsCache.fetch(null, () => this.userProfilesRepository.find({ + mutedWordsCache.fetch(() => this.userProfilesRepository.find({ where: { enableWordMute: true, }, |