perf(server): Reduce database query

This commit is contained in:
syuilo 2021-03-21 21:27:49 +09:00
parent ee16b1850b
commit c6fc5b2175

View file

@ -53,12 +53,11 @@ export default async (user: User, note: Note, reaction?: string) => {
await Notes.createQueryBuilder().update()
.set({
reactions: () => sql,
score: () => '"score" + 1'
})
.where('id = :id', { id: note.id })
.execute();
Notes.increment({ id: note.id }, 'score', 1);
perUserReactionsChart.update(user, note);
// カスタム絵文字リアクションだったら絵文字情報も送る