1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-24 22:36:19 -04:00

Fixed: Refreshing Plex Server series in high volume systems

This commit is contained in:
Taloth Saldono
2020-06-04 00:11:45 +02:00
parent e8d843c93d
commit 903aba5dee
9 changed files with 223 additions and 34 deletions
@@ -17,7 +17,10 @@ namespace NzbDrone.Core.Notifications
: IHandle<EpisodeGrabbedEvent>,
IHandle<EpisodeImportedEvent>,
IHandle<SeriesRenamedEvent>,
IHandle<HealthCheckFailedEvent>
IHandle<HealthCheckFailedEvent>,
IHandleAsync<DownloadsProcessedEvent>,
IHandleAsync<RenameCompletedEvent>,
IHandleAsync<HealthCheckCompleteEvent>
{
private readonly INotificationFactory _notificationFactory;
private readonly Logger _logger;
@@ -204,5 +207,35 @@ namespace NzbDrone.Core.Notifications
}
}
}
public void HandleAsync(DownloadsProcessedEvent message)
{
ProcessQueue();
}
public void HandleAsync(RenameCompletedEvent message)
{
ProcessQueue();
}
public void HandleAsync(HealthCheckCompleteEvent message)
{
ProcessQueue();
}
private void ProcessQueue()
{
foreach (var notification in _notificationFactory.GetAvailableProviders())
{
try
{
notification.ProcessQueue();
}
catch (Exception ex)
{
_logger.Warn(ex, "Unable to process notification queue for " + notification.Definition.Name);
}
}
}
}
}