mirror of
https://github.com/Prowlarr/Prowlarr
synced 2025-12-06 08:34:28 +01:00
Fixed: Indexer Error handling improvements (#1172)
* Fixed: Indexer Error handling improvements * fixup! Fixed: Indexer Error handling improvements
This commit is contained in:
parent
1cce39b404
commit
cd3e99ad87
1 changed files with 4 additions and 10 deletions
|
|
@ -210,7 +210,7 @@ protected virtual async Task<IndexerPageableQueryResult> FetchReleases(Func<IInd
|
|||
}
|
||||
|
||||
if (webException.Message.Contains("502") || webException.Message.Contains("503") ||
|
||||
webException.Message.Contains("timed out"))
|
||||
webException.Message.Contains("504") || webException.Message.Contains("timed out"))
|
||||
{
|
||||
_logger.Warn("{0} server is currently unavailable. {1} {2}", this, url, webException.Message);
|
||||
}
|
||||
|
|
@ -223,16 +223,10 @@ protected virtual async Task<IndexerPageableQueryResult> FetchReleases(Func<IInd
|
|||
{
|
||||
result.Queries.Add(new IndexerQueryResult { Response = ex.Response });
|
||||
|
||||
if (ex.RetryAfter != TimeSpan.Zero)
|
||||
{
|
||||
_indexerStatusService.RecordFailure(Definition.Id, ex.RetryAfter);
|
||||
}
|
||||
else
|
||||
{
|
||||
_indexerStatusService.RecordFailure(Definition.Id, TimeSpan.FromHours(1));
|
||||
}
|
||||
var retryTime = ex.RetryAfter != TimeSpan.Zero ? ex.RetryAfter : TimeSpan.FromHours(1);
|
||||
|
||||
_logger.Warn("Request Limit reached for {0}", this);
|
||||
_indexerStatusService.RecordFailure(Definition.Id, retryTime);
|
||||
_logger.Warn("Request Limit reached for {0}. Disabled for {1}", this, retryTime);
|
||||
}
|
||||
catch (HttpException ex)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue