diff --git a/src/FilterLists.Agent/ListArchiver/DownloadLists.cs b/src/FilterLists.Agent/ListArchiver/DownloadLists.cs index fb83c43f8..d1f5008b9 100644 --- a/src/FilterLists.Agent/ListArchiver/DownloadLists.cs +++ b/src/FilterLists.Agent/ListArchiver/DownloadLists.cs @@ -13,12 +13,12 @@ public static class DownloadLists { public class Command : IRequest { - public Command(IEnumerable lists) + public Command(IEnumerable listInfo) { - Lists = lists; + ListInfo = listInfo; } - public IEnumerable Lists { get; } + public IEnumerable ListInfo { get; } } public class Handler : AsyncRequestHandler @@ -27,10 +27,10 @@ public class Handler : AsyncRequestHandler private readonly HttpClient _httpClient; private readonly IMediator _mediator; - public Handler(IMediator mediator, HttpClient httpClient) + public Handler(HttpClient httpClient, IMediator mediator) { - _mediator = mediator; _httpClient = httpClient; + _mediator = mediator; } // https://stackoverflow.com/a/22492731/2343739 @@ -42,11 +42,11 @@ protected override async Task Handle(Command request, CancellationToken cancella ); var buffer = new BufferBlock(); downloader.LinkTo(buffer); - foreach (var list in request.Lists) + foreach (var list in request.ListInfo) await downloader.SendAsync(list, cancellationToken); downloader.Complete(); - foreach (var _ in request.Lists) + foreach (var _ in request.ListInfo) { var listDownload = await buffer.ReceiveAsync(cancellationToken); await _mediator.Send(new DownloadList.Command(listDownload), cancellationToken);