From 89848926bf8cbe7f348c97f8f3e888273f474bd3 Mon Sep 17 00:00:00 2001 From: "Collin M. Barrett" Date: Fri, 28 Jun 2019 19:53:33 -0500 Subject: [PATCH] small tidies --- src/FilterLists.Agent/ListArchiver/DownloadLists.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/FilterLists.Agent/ListArchiver/DownloadLists.cs b/src/FilterLists.Agent/ListArchiver/DownloadLists.cs index e93bcfb79..b822759ff 100644 --- a/src/FilterLists.Agent/ListArchiver/DownloadLists.cs +++ b/src/FilterLists.Agent/ListArchiver/DownloadLists.cs @@ -22,7 +22,7 @@ public Command(IEnumerable listInfo) public class Handler : AsyncRequestHandler { - 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 ShardByHost(IEnumerable 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); } } }