Add one minute back-off level for all providers
This commit is contained in:
parent
901b6d2084
commit
d8f314ff0e
|
@ -91,7 +91,7 @@ namespace NzbDrone.Core.Test.ThingiProviderTests
|
||||||
var status = Subject.GetBlockedProviders().FirstOrDefault();
|
var status = Subject.GetBlockedProviders().FirstOrDefault();
|
||||||
status.Should().NotBeNull();
|
status.Should().NotBeNull();
|
||||||
status.DisabledTill.Should().HaveValue();
|
status.DisabledTill.Should().HaveValue();
|
||||||
status.DisabledTill.Value.Should().BeCloseTo(_epoch + TimeSpan.FromMinutes(5), _disabledTillPrecision);
|
status.DisabledTill.Value.Should().BeCloseTo(_epoch + TimeSpan.FromMinutes(1), _disabledTillPrecision);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -134,7 +134,7 @@ namespace NzbDrone.Core.Test.ThingiProviderTests
|
||||||
var status = Subject.GetBlockedProviders().FirstOrDefault();
|
var status = Subject.GetBlockedProviders().FirstOrDefault();
|
||||||
status.Should().NotBeNull();
|
status.Should().NotBeNull();
|
||||||
status.DisabledTill.Should().HaveValue();
|
status.DisabledTill.Should().HaveValue();
|
||||||
status.DisabledTill.Value.Should().BeCloseTo(_epoch + TimeSpan.FromMinutes(15), _disabledTillPrecision);
|
status.DisabledTill.Value.Should().BeCloseTo(_epoch + TimeSpan.FromMinutes(5), _disabledTillPrecision);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
namespace NzbDrone.Core.ThingiProvider.Status
|
namespace NzbDrone.Core.ThingiProvider.Status
|
||||||
{
|
{
|
||||||
public static class EscalationBackOff
|
public static class EscalationBackOff
|
||||||
{
|
{
|
||||||
public static readonly int[] Periods =
|
public static readonly int[] Periods =
|
||||||
{
|
{
|
||||||
0,
|
0,
|
||||||
|
60,
|
||||||
5 * 60,
|
5 * 60,
|
||||||
15 * 60,
|
15 * 60,
|
||||||
30 * 60,
|
30 * 60,
|
||||||
|
|
|
@ -116,7 +116,7 @@ namespace NzbDrone.Core.ThingiProvider.Status
|
||||||
|
|
||||||
if (inStartupGracePeriod && minimumBackOff == TimeSpan.Zero && status.DisabledTill.HasValue)
|
if (inStartupGracePeriod && minimumBackOff == TimeSpan.Zero && status.DisabledTill.HasValue)
|
||||||
{
|
{
|
||||||
var maximumDisabledTill = now + TimeSpan.FromSeconds(EscalationBackOff.Periods[1]);
|
var maximumDisabledTill = now + TimeSpan.FromSeconds(EscalationBackOff.Periods[2]);
|
||||||
if (maximumDisabledTill < status.DisabledTill)
|
if (maximumDisabledTill < status.DisabledTill)
|
||||||
{
|
{
|
||||||
status.DisabledTill = maximumDisabledTill;
|
status.DisabledTill = maximumDisabledTill;
|
||||||
|
|
Loading…
Reference in New Issue