New: Make indexer HTTP requests async

This commit is contained in:
ta264
2021-03-17 21:20:57 +00:00
committed by Qstick
parent 231d43e181
commit 29da0b7031
29 changed files with 216 additions and 213 deletions

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using FluentValidation.Results;
using NLog;
using NzbDrone.Common.Http;
@@ -95,18 +96,18 @@ namespace NzbDrone.Core.Indexers.Cardigann
return generator.CheckIfLoginIsNeeded(httpResponse);
}
protected override void DoLogin()
protected override async Task DoLogin()
{
var generator = (CardigannRequestGenerator)GetRequestGenerator();
SetCookieFunctions(generator);
generator.DoLogin();
await generator.DoLogin();
}
protected override void Test(List<ValidationFailure> failures)
protected override async Task Test(List<ValidationFailure> failures)
{
base.Test(failures);
await base.Test(failures);
if (failures.HasErrors())
{
return;