mirror of
https://github.com/paricafe/misskey.git
synced 2025-02-19 09:57:30 -06:00
perf(server): Improve following/followers API performance
Related #6813
This commit is contained in:
parent
d7e7848c92
commit
e987a50e9f
2 changed files with 4 additions and 2 deletions
src/server/api/endpoints/users
|
@ -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…
Add table
Reference in a new issue