mirror of
https://github.com/Sonarr/Sonarr
synced 2024-12-27 02:07:41 +00:00
less chatty command events.
This commit is contained in:
parent
634cc32ad8
commit
492b1715e4
1 changed files with 11 additions and 2 deletions
|
@ -101,7 +101,7 @@ namespace NzbDrone.Core.Messaging.Commands
|
|||
try
|
||||
{
|
||||
_trackCommands.Start(command);
|
||||
_eventAggregator.PublishEvent(new CommandUpdatedEvent(command));
|
||||
BroadcastCommandUpdate(command);
|
||||
|
||||
if (!MappedDiagnosticsContext.Contains("CommandId") && command.SendUpdatesToClient)
|
||||
{
|
||||
|
@ -118,7 +118,7 @@ namespace NzbDrone.Core.Messaging.Commands
|
|||
}
|
||||
finally
|
||||
{
|
||||
_eventAggregator.PublishEvent(new CommandUpdatedEvent(command));
|
||||
BroadcastCommandUpdate(command);
|
||||
_eventAggregator.PublishEvent(new CommandExecutedEvent(command));
|
||||
|
||||
if (MappedDiagnosticsContext.Get("CommandId") == command.Id.ToString())
|
||||
|
@ -129,5 +129,14 @@ namespace NzbDrone.Core.Messaging.Commands
|
|||
|
||||
_logger.Trace("{0} <- {1} [{2}]", command.GetType().Name, handler.GetType().Name, command.Runtime.ToString(""));
|
||||
}
|
||||
|
||||
|
||||
private void BroadcastCommandUpdate(Command command)
|
||||
{
|
||||
if (command.SendUpdatesToClient)
|
||||
{
|
||||
_eventAggregator.PublishEvent(new CommandUpdatedEvent(command));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue