From 3bbac6f5d197b8ce422422bc2b9572524b5082fc Mon Sep 17 00:00:00 2001 From: riku6460 <17585784+riku6460@users.noreply.github.com> Date: Sun, 8 Oct 2023 04:57:59 +0900 Subject: [PATCH] =?UTF-8?q?NoteEntityService=20=E3=81=AE=20pack=20?= =?UTF-8?q?=E5=86=85=E3=81=A7=20CustomEmojiService=20=E3=81=AE=20prefetchE?= =?UTF-8?q?mojis=20=E3=82=92=E5=91=BC=E3=81=B6=20(MisskeyIO#179)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit streaming から Note の pack を行う際に populateEmojis から大量にクエリが飛ぶのを回避する prefetchEmojis ではキャッシュ済みのものを除外しているため、packMany が呼ばれた場合でも大量にクエリが飛ぶことはない --- packages/backend/src/core/entities/NoteEntityService.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/backend/src/core/entities/NoteEntityService.ts b/packages/backend/src/core/entities/NoteEntityService.ts index 987c9a3016..3eaf671c68 100644 --- a/packages/backend/src/core/entities/NoteEntityService.ts +++ b/packages/backend/src/core/entities/NoteEntityService.ts @@ -324,6 +324,7 @@ export class NoteEntityService implements OnModuleInit { const reactionEmojiNames = Object.keys(note.reactions) .filter(x => x.startsWith(':') && x.includes('@') && !x.includes('@.')) // リモートカスタム絵文字のみ .map(x => this.reactionService.decodeReaction(x).reaction.replaceAll(':', '')); + await this.customEmojiService.prefetchEmojis(this.aggregateNoteEmojis([note])); const packedFiles = options?._hint_?.packedFiles; const packed: Packed<'Note'> = await awaitAll({