Skip to content

Commit

Permalink
NoteEntityService の pack 内で CustomEmojiService の prefetchEmojis を呼ぶ (#…
Browse files Browse the repository at this point in the history
…179)

streaming から Note の pack を行う際に populateEmojis から大量にクエリが飛ぶのを回避する

prefetchEmojis ではキャッシュ済みのものを除外しているため、packMany が呼ばれた場合でも大量にクエリが飛ぶことはない
  • Loading branch information
riku6460 authored Oct 7, 2023
1 parent 2b307bb commit 3bbac6f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/backend/src/core/entities/NoteEntityService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit 3bbac6f

Please sign in to comment.