mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-25 22:37:27 -04:00
New: On Health Restored notification
(cherry picked from commit 5fdc8514da7c7ad98192f2ecb2415b3a7b5d0d05)
This commit is contained in:
@@ -23,6 +23,7 @@ namespace NzbDrone.Core.Notifications
|
||||
IHandle<MoviesImportedEvent>,
|
||||
IHandle<MovieFileDeletedEvent>,
|
||||
IHandle<HealthCheckFailedEvent>,
|
||||
IHandle<HealthCheckRestoredEvent>,
|
||||
IHandle<UpdateInstalledEvent>,
|
||||
IHandleAsync<DeleteCompletedEvent>,
|
||||
IHandleAsync<DownloadsProcessedEvent>,
|
||||
@@ -311,6 +312,29 @@ namespace NzbDrone.Core.Notifications
|
||||
}
|
||||
}
|
||||
|
||||
public void Handle(HealthCheckRestoredEvent message)
|
||||
{
|
||||
if (message.IsInStartupGracePeriod)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var notification in _notificationFactory.OnHealthRestoredEnabled())
|
||||
{
|
||||
try
|
||||
{
|
||||
if (ShouldHandleHealthFailure(message.PreviousCheck, ((NotificationDefinition)notification.Definition).IncludeHealthWarnings))
|
||||
{
|
||||
notification.OnHealthRestored(message.PreviousCheck);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Warn(ex, "Unable to send OnHealthRestored notification to: " + notification.Definition.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void HandleAsync(DeleteCompletedEvent message)
|
||||
{
|
||||
ProcessQueue();
|
||||
|
||||
Reference in New Issue
Block a user