mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Do not blowup notificaiton pipeline when on notification throws
This commit is contained in:
@@ -154,34 +154,52 @@ namespace NzbDrone.Core.Notifications
|
||||
{
|
||||
var messageBody = GetMessage(message.Episode.ParsedEpisodeInfo, message.Episode.Series);
|
||||
|
||||
All().Where(n => n.OnGrab)
|
||||
.ToList()
|
||||
.ForEach(notification =>
|
||||
notification.Instance
|
||||
.OnGrab(messageBody)
|
||||
);
|
||||
foreach (var notification in All().Where(n => n.OnGrab))
|
||||
{
|
||||
try
|
||||
{
|
||||
notification.Instance.OnGrab(messageBody);
|
||||
}
|
||||
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.WarnException("Unable to send OnGrab notification to: " + notification.Name, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Handle(EpisodeDownloadedEvent message)
|
||||
{
|
||||
var messageBody = GetMessage(message.ParsedEpisodeInfo, message.Series);
|
||||
|
||||
All().Where(n => n.OnDownload)
|
||||
.ToList()
|
||||
.ForEach(notification =>
|
||||
notification.Instance
|
||||
.OnDownload(messageBody, message.Series)
|
||||
);
|
||||
foreach (var notification in All().Where(n => n.OnDownload))
|
||||
{
|
||||
try
|
||||
{
|
||||
notification.Instance.OnDownload(messageBody, message.Series);
|
||||
}
|
||||
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.WarnException("Unable to send OnDownload notification to: " + notification.Name, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Handle(SeriesRenamedEvent message)
|
||||
{
|
||||
All().Where(n => n.OnDownload)
|
||||
.ToList()
|
||||
.ForEach(notification =>
|
||||
notification.Instance
|
||||
.AfterRename(message.Series)
|
||||
);
|
||||
foreach (var notification in All().Where(n => n.OnDownload))
|
||||
{
|
||||
try
|
||||
{
|
||||
notification.Instance.AfterRename(message.Series);
|
||||
}
|
||||
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.WarnException("Unable to send AfterRename notification to: " + notification.Name, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user