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); } } }