diff --git a/NzbDrone.Core/Messaging/MessageAggregator.cs b/NzbDrone.Core/Messaging/MessageAggregator.cs index 4d3ed04331..499bef32af 100644 --- a/NzbDrone.Core/Messaging/MessageAggregator.cs +++ b/NzbDrone.Core/Messaging/MessageAggregator.cs @@ -166,6 +166,13 @@ private void ExecuteCommand(Command command) where TCommand : Command PublishEvent(new CommandUpdatedEvent(command)); throw; } + finally + { + if (MappedDiagnosticsContext.Get("CommandId") == command.Id.ToString()) + { + MappedDiagnosticsContext.Remove("CommandId"); + } + } PublishEvent(new CommandExecutedEvent(command)); PublishEvent(new CommandUpdatedEvent(command));