mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
small tidies
This commit is contained in:
parent
e193b20442
commit
89848926bf
1 changed files with 5 additions and 5 deletions
|
|
@ -22,7 +22,7 @@ public Command(IEnumerable<ListInfo> listInfo)
|
|||
|
||||
public class Handler : AsyncRequestHandler<Command>
|
||||
{
|
||||
private const int MaxDegreeOfParallelism = 20; //TODO: tune
|
||||
private const int MaxDegreeOfParallelism = 5; //TODO: tune
|
||||
private readonly IMediator _mediator;
|
||||
|
||||
public Handler(IMediator mediator)
|
||||
|
|
@ -47,10 +47,10 @@ protected override async Task Handle(Command request, CancellationToken cancella
|
|||
private static IEnumerable<ListInfo> ShardByHost(IEnumerable<ListInfo> listInfo)
|
||||
{
|
||||
return listInfo.GroupBy(l => l.ViewUrl.Host)
|
||||
.SelectMany((g, gi) => g.Select((l, li) => new {Index = li, GroupIndex = gi, Value = l}))
|
||||
.OrderBy(u => u.Index)
|
||||
.ThenBy(u => u.GroupIndex)
|
||||
.Select(u => u.Value);
|
||||
.SelectMany((g, gi) => g.Select((l, li) => new {Index = li, GroupIndex = gi, ListInfo = l}))
|
||||
.OrderBy(a => a.Index)
|
||||
.ThenBy(a => a.GroupIndex)
|
||||
.Select(a => a.ListInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue