From 21de5c4a9c74ca069454325adc1555eb370226df Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 21 Mar 2022 05:42:11 +0900 Subject: [PATCH] perf(server): reduce db query --- packages/backend/src/remote/activitypub/renderer/note.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/backend/src/remote/activitypub/renderer/note.ts b/packages/backend/src/remote/activitypub/renderer/note.ts index c3d9e120d..78190751f 100644 --- a/packages/backend/src/remote/activitypub/renderer/note.ts +++ b/packages/backend/src/remote/activitypub/renderer/note.ts @@ -53,9 +53,7 @@ export default async function renderNote(note: Note, dive = true, isTalk = false } } - const user = await Users.findOneOrFail(note.userId); - - const attributedTo = `${config.url}/users/${user.id}`; + const attributedTo = `${config.url}/users/${note.userId}`; const mentions = (JSON.parse(note.mentionedRemoteUsers) as IMentionedRemoteUsers).map(x => x.uri);