mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Fixed: Don't apply indexer backoff on DNS and connection issues.
Fixes #751
This commit is contained in:
@@ -201,8 +201,17 @@ namespace NzbDrone.Core.Indexers
|
|||||||
_indexerStatusService.RecordSuccess(Definition.Id);
|
_indexerStatusService.RecordSuccess(Definition.Id);
|
||||||
}
|
}
|
||||||
catch (WebException webException)
|
catch (WebException webException)
|
||||||
|
{
|
||||||
|
if (webException.Status == WebExceptionStatus.NameResolutionFailure ||
|
||||||
|
webException.Status == WebExceptionStatus.ConnectFailure)
|
||||||
|
{
|
||||||
|
_indexerStatusService.RecordConnectionFailure(Definition.Id);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
_indexerStatusService.RecordFailure(Definition.Id);
|
_indexerStatusService.RecordFailure(Definition.Id);
|
||||||
|
}
|
||||||
|
|
||||||
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("timed out"))
|
||||||
{
|
{
|
||||||
|
@@ -15,6 +15,7 @@ namespace NzbDrone.Core.Indexers
|
|||||||
ReleaseInfo GetLastRssSyncReleaseInfo(int indexerId);
|
ReleaseInfo GetLastRssSyncReleaseInfo(int indexerId);
|
||||||
void RecordSuccess(int indexerId);
|
void RecordSuccess(int indexerId);
|
||||||
void RecordFailure(int indexerId, TimeSpan minimumBackOff = default(TimeSpan));
|
void RecordFailure(int indexerId, TimeSpan minimumBackOff = default(TimeSpan));
|
||||||
|
void RecordConnectionFailure(int indexerId);
|
||||||
|
|
||||||
void UpdateRssSyncStatus(int indexerId, ReleaseInfo releaseInfo);
|
void UpdateRssSyncStatus(int indexerId, ReleaseInfo releaseInfo);
|
||||||
}
|
}
|
||||||
@@ -85,7 +86,7 @@ namespace NzbDrone.Core.Indexers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RecordFailure(int indexerId, TimeSpan minimumBackOff = default(TimeSpan))
|
protected void RecordFailure(int indexerId, TimeSpan minimumBackOff, bool escalate)
|
||||||
{
|
{
|
||||||
lock (_syncRoot)
|
lock (_syncRoot)
|
||||||
{
|
{
|
||||||
@@ -99,7 +100,10 @@ namespace NzbDrone.Core.Indexers
|
|||||||
}
|
}
|
||||||
|
|
||||||
status.MostRecentFailure = now;
|
status.MostRecentFailure = now;
|
||||||
|
if (escalate)
|
||||||
|
{
|
||||||
status.EscalationLevel = Math.Min(MaximumEscalationLevel, status.EscalationLevel + 1);
|
status.EscalationLevel = Math.Min(MaximumEscalationLevel, status.EscalationLevel + 1);
|
||||||
|
}
|
||||||
|
|
||||||
if (minimumBackOff != TimeSpan.Zero)
|
if (minimumBackOff != TimeSpan.Zero)
|
||||||
{
|
{
|
||||||
@@ -115,6 +119,17 @@ namespace NzbDrone.Core.Indexers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void RecordFailure(int indexerId, TimeSpan minimumBackOff = default(TimeSpan))
|
||||||
|
{
|
||||||
|
RecordFailure(indexerId, minimumBackOff, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RecordConnectionFailure(int indexerId)
|
||||||
|
{
|
||||||
|
RecordFailure(indexerId, default(TimeSpan), false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void UpdateRssSyncStatus(int indexerId, ReleaseInfo releaseInfo)
|
public void UpdateRssSyncStatus(int indexerId, ReleaseInfo releaseInfo)
|
||||||
{
|
{
|
||||||
lock (_syncRoot)
|
lock (_syncRoot)
|
||||||
|
Reference in New Issue
Block a user