mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-29 05:17:39 -07:00
perf(server): Reduce database query
This commit is contained in:
parent
ee16b1850b
commit
c6fc5b2175
1 changed files with 1 additions and 2 deletions
|
@ -53,12 +53,11 @@ export default async (user: User, note: Note, reaction?: string) => {
|
||||||
await Notes.createQueryBuilder().update()
|
await Notes.createQueryBuilder().update()
|
||||||
.set({
|
.set({
|
||||||
reactions: () => sql,
|
reactions: () => sql,
|
||||||
|
score: () => '"score" + 1'
|
||||||
})
|
})
|
||||||
.where('id = :id', { id: note.id })
|
.where('id = :id', { id: note.id })
|
||||||
.execute();
|
.execute();
|
||||||
|
|
||||||
Notes.increment({ id: note.id }, 'score', 1);
|
|
||||||
|
|
||||||
perUserReactionsChart.update(user, note);
|
perUserReactionsChart.update(user, note);
|
||||||
|
|
||||||
// カスタム絵文字リアクションだったら絵文字情報も送る
|
// カスタム絵文字リアクションだったら絵文字情報も送る
|
||||||
|
|
Loading…
Reference in a new issue