Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 4d31f65

Browse files
committed
Show max 100 recently pushed repos for each org
Limit the number of repositories displayed for each org to the 100 most recently pushed ones. This should stop organizations with 1000s of repositories from having a disproportional impact on the load time.
1 parent b830a6d commit 4d31f65

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/GitHub.App/Services/RepositoryCloneService.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.IO;
55
using System.Linq;
66
using System.Reactive.Linq;
7+
using System.Threading;
78
using System.Threading.Tasks;
89
using GitHub.Api;
910
using GitHub.Extensions;
@@ -69,8 +70,8 @@ public async Task<ViewerRepositoriesModel> ReadViewerRepositories(HostAddress ad
6970
{
7071
var order = new RepositoryOrder
7172
{
72-
Field = RepositoryOrderField.Name,
73-
Direction = OrderDirection.Asc
73+
Field = RepositoryOrderField.PushedAt,
74+
Direction = OrderDirection.Desc
7475
};
7576

7677
var affiliation = new RepositoryAffiliation?[]
@@ -100,8 +101,8 @@ public async Task<ViewerRepositoriesModel> ReadViewerRepositories(HostAddress ad
100101
Organizations = viewer.Organizations(null, null, null, null).AllPages().Select(org => new
101102
{
102103
org.Login,
103-
Repositories = org.Repositories(null, null, null, null, null, null, null, order, null, null)
104-
.AllPages()
104+
Repositories = org.Repositories(100, null, null, null, null, null, null, order, null, null)
105+
.Nodes
105106
.Select(repositorySelection).ToList()
106107
}).ToDictionary(x => x.Login, x => (IReadOnlyList<RepositoryListItemModel>)x.Repositories),
107108
}).Compile();

0 commit comments

Comments
 (0)