perf: improve the perf of Anonymous GitHub

This commit is contained in:
tdurieux
2023-02-08 09:49:24 +01:00
parent 73f7582fd2
commit 2e36b72a7f
12 changed files with 115 additions and 53 deletions

View File

@@ -119,9 +119,14 @@ export default class User {
*/
async getRepositories() {
const repositories = (
await AnonymizedRepositoryModel.find({
owner: this.id,
}).exec()
await AnonymizedRepositoryModel.find(
{
owner: this.id,
},
{
originalFiles: 0,
}
).exec()
).map((d) => new Repository(d));
const promises = [];
for (let repo of repositories) {