Fixed: Indexer Error handling improvements (#1172)

* Fixed: Indexer Error handling improvements

* fixup! Fixed: Indexer Error handling improvements
pull/1226/head
bakerboy448 2 years ago committed by GitHub
parent 1cce39b404
commit cd3e99ad87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -210,7 +210,7 @@ namespace NzbDrone.Core.Indexers
} }
if (webException.Message.Contains("502") || webException.Message.Contains("503") || 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); _logger.Warn("{0} server is currently unavailable. {1} {2}", this, url, webException.Message);
} }
@ -223,16 +223,10 @@ namespace NzbDrone.Core.Indexers
{ {
result.Queries.Add(new IndexerQueryResult { Response = ex.Response }); result.Queries.Add(new IndexerQueryResult { Response = ex.Response });
if (ex.RetryAfter != TimeSpan.Zero) var retryTime = ex.RetryAfter != TimeSpan.Zero ? ex.RetryAfter : TimeSpan.FromHours(1);
{
_indexerStatusService.RecordFailure(Definition.Id, ex.RetryAfter);
}
else
{
_indexerStatusService.RecordFailure(Definition.Id, 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) catch (HttpException ex)
{ {

Loading…
Cancel
Save