perf(guild): fetch guild members a thousand at a time (#2201)

This commit is contained in:
Hampus
2026-08-31 00:06:41 +02:00
committed by GitHub
parent 0d4c65ad79
commit e993a47720
3 changed files with 104 additions and 2 deletions
+3 -1
View File
@@ -1360,7 +1360,9 @@ export class RpcService {
afterUserId?: UserID;
limit?: number;
}): Promise<RpcResponseGuildCollectionData> {
await this.getGuildOrThrow(guildId);
if (!afterUserId) {
await this.getGuildOrThrow(guildId);
}
const chunkSize = this.resolveGuildCollectionLimit(limit);
const members = await this.guildRepository.listMembersPaginated(guildId, chunkSize + 1, afterUserId);
const hasMore = members.length > chunkSize;