diff --git a/src/FilterLists.Agent/Features/Urls/ValidateAllUrls.cs b/src/FilterLists.Agent/Features/Urls/ValidateAllUrls.cs index f96057200..1a93dae09 100644 --- a/src/FilterLists.Agent/Features/Urls/ValidateAllUrls.cs +++ b/src/FilterLists.Agent/Features/Urls/ValidateAllUrls.cs @@ -31,32 +31,27 @@ protected override async Task Handle(Command request, CancellationToken cancella var results = new List(); var licenseUrls = await _repo.GetAllAsync(); - var licenseUrlErrors = (await _mediator.Send(new ValidateUrls.Command(licenseUrls), cancellationToken)) - .ToList(); + var licenseUrlErrors = (await _mediator.Send(new ValidateUrls.Command(licenseUrls), cancellationToken)); if (licenseUrlErrors.Any()) results.Add(new DataFileUrlValidationResults("License.json", licenseUrlErrors)); var listUrls = await _repo.GetAllAsync(); - var listUrlErrors = - (await _mediator.Send(new ValidateUrls.Command(listUrls), cancellationToken)).ToList(); + var listUrlErrors = (await _mediator.Send(new ValidateUrls.Command(listUrls), cancellationToken)); if (listUrlErrors.Any()) results.Add(new DataFileUrlValidationResults("FilterList.json", listUrlErrors)); var maintainerUrls = await _repo.GetAllAsync(); - var maintainerUrlErrors = - (await _mediator.Send(new ValidateUrls.Command(maintainerUrls), cancellationToken)).ToList(); + var maintainerUrlErrors = (await _mediator.Send(new ValidateUrls.Command(maintainerUrls), cancellationToken)); if (maintainerUrlErrors.Any()) results.Add(new DataFileUrlValidationResults("Maintainer.json", maintainerUrlErrors)); var softwareUrls = await _repo.GetAllAsync(); - var softwareUrlErrors = - (await _mediator.Send(new ValidateUrls.Command(softwareUrls), cancellationToken)).ToList(); + var softwareUrlErrors = (await _mediator.Send(new ValidateUrls.Command(softwareUrls), cancellationToken)); if (softwareUrlErrors.Any()) results.Add(new DataFileUrlValidationResults("Software.json", softwareUrlErrors)); var syntaxUrls = await _repo.GetAllAsync(); - var syntaxUrlErrors = (await _mediator.Send(new ValidateUrls.Command(syntaxUrls), cancellationToken)) - .ToList(); + var syntaxUrlErrors = (await _mediator.Send(new ValidateUrls.Command(syntaxUrls), cancellationToken)); if (syntaxUrlErrors.Any()) results.Add(new DataFileUrlValidationResults("Syntax.json", syntaxUrlErrors)); diff --git a/src/FilterLists.Agent/Features/Urls/ValidateUrls.cs b/src/FilterLists.Agent/Features/Urls/ValidateUrls.cs index d35de6e7b..adfd98b54 100644 --- a/src/FilterLists.Agent/Features/Urls/ValidateUrls.cs +++ b/src/FilterLists.Agent/Features/Urls/ValidateUrls.cs @@ -13,7 +13,7 @@ namespace FilterLists.Agent.Features.Urls { public static class ValidateUrls { - public class Command : IRequest> + public class Command : IRequest> { public Command(IEnumerable urls) { @@ -23,7 +23,7 @@ public Command(IEnumerable urls) public IEnumerable Urls { get; } } - public class Handler : IRequestHandler> + public class Handler : IRequestHandler> { private const int MaxDegreeOfParallelism = 5; private readonly HttpClient _httpClient; @@ -33,8 +33,7 @@ public Handler(AgentHttpClient agentHttpClient) _httpClient = agentHttpClient.Client; } - public async Task> Handle(Command request, - CancellationToken cancellationToken) + public async Task> Handle(Command request, CancellationToken cancellationToken) { var validator = BuildValidator(cancellationToken); var brokenUrls = new List();