1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-11-01 07:35:57 +09:00

fix(backend): timeout when querying mentions (#11799)

This commit is contained in:
Ezekiel Lee 2023-09-08 07:44:46 +08:00 committed by GitHub
parent 90b058e226
commit af7e129b1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -63,6 +63,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
.where(`'{"${me.id}"}' <@ note.mentions`)
.orWhere(`'{"${me.id}"}' <@ note.visibleUserIds`);
}))
// Avoid scanning primary key index
.orderBy('CONCAT(note.id)', 'DESC')
.innerJoinAndSelect('note.user', 'user')
.leftJoinAndSelect('note.reply', 'reply')
.leftJoinAndSelect('note.renote', 'renote')