1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-17 21:26:13 -04:00

New: On Health Restored notification

Closes #4262
This commit is contained in:
The Dark
2023-05-08 02:57:14 +01:00
committed by GitHub
parent fbf79c6639
commit 5fdc8514da
36 changed files with 285 additions and 5 deletions

View File

@@ -274,6 +274,21 @@ namespace NzbDrone.Core.Notifications.CustomScript
ExecuteScript(environmentVariables);
}
public override void OnHealthRestored(HealthCheck.HealthCheck previousCheck)
{
var environmentVariables = new StringDictionary();
environmentVariables.Add("Sonarr_EventType", "HealthRestored");
environmentVariables.Add("Sonarr_InstanceName", _configFileProvider.InstanceName);
environmentVariables.Add("Sonarr_ApplicationUrl", _configService.ApplicationUrl);
environmentVariables.Add("Sonarr_Health_Restored_Level", Enum.GetName(typeof(HealthCheckResult), previousCheck.Type));
environmentVariables.Add("Sonarr_Health_Restored_Message", previousCheck.Message);
environmentVariables.Add("Sonarr_Health_Restored_Type", previousCheck.Source.Name);
environmentVariables.Add("Sonarr_Health_Restored_Wiki", previousCheck.WikiUrl.ToString() ?? string.Empty);
ExecuteScript(environmentVariables);
}
public override void OnApplicationUpdate(ApplicationUpdateMessage updateMessage)
{
var environmentVariables = new StringDictionary();