mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-04-24 05:47:22 -04:00
Fixed: Run health checks for applications and download clients on bulk events
This commit is contained in:
parent
3dae84705c
commit
b2c5448cbf
3 changed files with 12 additions and 7 deletions
|
@ -9,6 +9,8 @@ namespace NzbDrone.Core.HealthCheck.Checks
|
|||
{
|
||||
[CheckOn(typeof(ProviderUpdatedEvent<IApplication>))]
|
||||
[CheckOn(typeof(ProviderDeletedEvent<IApplication>))]
|
||||
[CheckOn(typeof(ProviderBulkUpdatedEvent<IApplication>))]
|
||||
[CheckOn(typeof(ProviderBulkDeletedEvent<IApplication>))]
|
||||
[CheckOn(typeof(ProviderStatusChangedEvent<IApplication>))]
|
||||
public class ApplicationLongTermStatusCheck : HealthCheckBase
|
||||
{
|
||||
|
|
|
@ -9,6 +9,8 @@ namespace NzbDrone.Core.HealthCheck.Checks
|
|||
{
|
||||
[CheckOn(typeof(ProviderUpdatedEvent<IApplication>))]
|
||||
[CheckOn(typeof(ProviderDeletedEvent<IApplication>))]
|
||||
[CheckOn(typeof(ProviderBulkUpdatedEvent<IApplication>))]
|
||||
[CheckOn(typeof(ProviderBulkDeletedEvent<IApplication>))]
|
||||
[CheckOn(typeof(ProviderStatusChangedEvent<IApplication>))]
|
||||
public class ApplicationStatusCheck : HealthCheckBase
|
||||
{
|
||||
|
@ -26,13 +28,12 @@ namespace NzbDrone.Core.HealthCheck.Checks
|
|||
{
|
||||
var enabledProviders = _providerFactory.GetAvailableProviders();
|
||||
var backOffProviders = enabledProviders.Join(_providerStatusService.GetBlockedProviders(),
|
||||
i => i.Definition.Id,
|
||||
s => s.ProviderId,
|
||||
(i, s) => new { Provider = i, Status = s })
|
||||
.Where(p => p.Status.InitialFailure.HasValue &&
|
||||
p.Status.InitialFailure.Value.After(
|
||||
DateTime.UtcNow.AddHours(-6)))
|
||||
.ToList();
|
||||
i => i.Definition.Id,
|
||||
s => s.ProviderId,
|
||||
(i, s) => new { Provider = i, Status = s })
|
||||
.Where(p => p.Status.InitialFailure.HasValue &&
|
||||
p.Status.InitialFailure.Value.After(DateTime.UtcNow.AddHours(-6)))
|
||||
.ToList();
|
||||
|
||||
if (backOffProviders.Empty())
|
||||
{
|
||||
|
|
|
@ -8,6 +8,8 @@ namespace NzbDrone.Core.HealthCheck.Checks
|
|||
{
|
||||
[CheckOn(typeof(ProviderUpdatedEvent<IDownloadClient>))]
|
||||
[CheckOn(typeof(ProviderDeletedEvent<IDownloadClient>))]
|
||||
[CheckOn(typeof(ProviderBulkUpdatedEvent<IDownloadClient>))]
|
||||
[CheckOn(typeof(ProviderBulkDeletedEvent<IDownloadClient>))]
|
||||
[CheckOn(typeof(ProviderStatusChangedEvent<IDownloadClient>))]
|
||||
public class DownloadClientStatusCheck : HealthCheckBase
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue