Fix an issue where a request-timeout would cause a restartloop.
This commit is contained in:
parent
ca9c0b22c1
commit
f78bec43d6
@ -1,4 +1,5 @@
|
|||||||
using System.Net.Http.Headers;
|
using System.Net;
|
||||||
|
using System.Net.Http.Headers;
|
||||||
using HtmlAgilityPack;
|
using HtmlAgilityPack;
|
||||||
|
|
||||||
namespace Tranga.MangaConnectors;
|
namespace Tranga.MangaConnectors;
|
||||||
@ -32,8 +33,16 @@ internal class HttpDownloadClient : DownloadClient
|
|||||||
if (referrer is not null)
|
if (referrer is not null)
|
||||||
requestMessage.Headers.Referrer = new Uri(referrer);
|
requestMessage.Headers.Referrer = new Uri(referrer);
|
||||||
//Log($"Requesting {requestType} {url}");
|
//Log($"Requesting {requestType} {url}");
|
||||||
|
try
|
||||||
|
{
|
||||||
response = Client.Send(requestMessage);
|
response = Client.Send(requestMessage);
|
||||||
}
|
}
|
||||||
|
catch (TaskCanceledException e)
|
||||||
|
{
|
||||||
|
Log($"Request timed out.\n\r{e}");
|
||||||
|
return new RequestResult(HttpStatusCode.RequestTimeout, null, Stream.Null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!response.IsSuccessStatusCode)
|
if (!response.IsSuccessStatusCode)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user