Fixed: Blocking unknown indexers from pushed releases

Closes #5900
pull/6139/head
Mark McDowall 1 year ago
parent 58d841c463
commit 44d8dbaac8

@ -68,5 +68,16 @@ namespace NzbDrone.Core.Test.IndexerTests
VerifyNoUpdate(); VerifyNoUpdate();
} }
[Test]
public void should_not_record_failure_for_unknown_provider()
{
Subject.RecordFailure(0);
Mocker.GetMock<IIndexerStatusRepository>()
.Verify(v => v.FindByProviderId(1), Times.Never);
VerifyNoUpdate();
}
} }
} }

@ -79,6 +79,11 @@ namespace NzbDrone.Core.ThingiProvider.Status
protected virtual void RecordFailure(int providerId, TimeSpan minimumBackOff, bool escalate) protected virtual void RecordFailure(int providerId, TimeSpan minimumBackOff, bool escalate)
{ {
if (providerId <= 0)
{
return;
}
lock (_syncRoot) lock (_syncRoot)
{ {
var status = GetProviderStatus(providerId); var status = GetProviderStatus(providerId);

Loading…
Cancel
Save