From cd3e99ad874d0c766bb0e7c66541b05dfeb9efb3 Mon Sep 17 00:00:00 2001 From: bakerboy448 <55419169+bakerboy448@users.noreply.github.com> Date: Thu, 1 Dec 2022 21:30:27 -0600 Subject: [PATCH] Fixed: Indexer Error handling improvements (#1172) * Fixed: Indexer Error handling improvements * fixup! Fixed: Indexer Error handling improvements --- src/NzbDrone.Core/Indexers/HttpIndexerBase.cs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs b/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs index 7ab4417a4..14961ca8b 100644 --- a/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs +++ b/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs @@ -210,7 +210,7 @@ namespace NzbDrone.Core.Indexers } 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 @@ namespace NzbDrone.Core.Indexers { 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) {