mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-22 18:07:31 -07:00
perf(server): Improve following/followers API performance
Related #6813
This commit is contained in:
parent
d91d7a36c4
commit
517e6ad17a
2 changed files with 4 additions and 2 deletions
|
@ -76,7 +76,8 @@ export default define(meta, async (ps, me) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const query = makePaginationQuery(Followings.createQueryBuilder('following'), ps.sinceId, ps.untilId)
|
const query = makePaginationQuery(Followings.createQueryBuilder('following'), ps.sinceId, ps.untilId)
|
||||||
.andWhere(`following.followeeId = :userId`, { userId: user.id });
|
.andWhere(`following.followeeId = :userId`, { userId: user.id })
|
||||||
|
.innerJoinAndSelect('following.follower', 'follower');
|
||||||
|
|
||||||
const followings = await query
|
const followings = await query
|
||||||
.take(ps.limit!)
|
.take(ps.limit!)
|
||||||
|
|
|
@ -76,7 +76,8 @@ export default define(meta, async (ps, me) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const query = makePaginationQuery(Followings.createQueryBuilder('following'), ps.sinceId, ps.untilId)
|
const query = makePaginationQuery(Followings.createQueryBuilder('following'), ps.sinceId, ps.untilId)
|
||||||
.andWhere(`following.followerId = :userId`, { userId: user.id });
|
.andWhere(`following.followerId = :userId`, { userId: user.id })
|
||||||
|
.innerJoinAndSelect('following.followee', 'followee');
|
||||||
|
|
||||||
const followings = await query
|
const followings = await query
|
||||||
.take(ps.limit!)
|
.take(ps.limit!)
|
||||||
|
|
Loading…
Reference in a new issue