1
0
Fork 0
mirror of https://github.com/Jackett/Jackett synced 2025-01-18 21:50:33 +00:00

IWebClient: fix DelayRequest

This commit is contained in:
kaso17 2017-10-03 15:32:34 +02:00
parent 034edbd32a
commit 0e0d53fa00

View file

@ -40,7 +40,7 @@ namespace Jackett.Utils.Clients
configService = c;
}
async protected void DelayRequest(WebRequest request)
async protected Task DelayRequest(WebRequest request)
{
if (request.EmulateBrowser == null)
request.EmulateBrowser = EmulateBrowser;
@ -81,7 +81,7 @@ namespace Jackett.Utils.Clients
{
logger.Debug(string.Format("IWebClient.GetBytes(Url:{0})", request.Url));
PrepareRequest(request);
DelayRequest(request);
await DelayRequest(request);
var result = await Run(request);
result.Request = request;
logger.Debug(string.Format("IWebClient: Returning {0} => {1} bytes", result.Status, (result.IsRedirect ? result.RedirectingTo + " " : "") + (result.Content == null ? "<NULL>" : result.Content.Length.ToString())));
@ -92,7 +92,7 @@ namespace Jackett.Utils.Clients
{
logger.Debug(string.Format("IWebClient.GetString(Url:{0})", request.Url));
PrepareRequest(request);
DelayRequest(request);
await DelayRequest(request);
var result = await Run(request);
result.Request = request;
WebClientStringResult stringResult = Mapper.Map<WebClientStringResult>(result);