From 909439f6156e15ce16c53a825f9b219b4b120e4b Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Fri, 13 Sep 2013 23:20:10 -0700 Subject: [PATCH] cleanup CommandId from MappedDiagnosticsContext --- NzbDrone.Core/Messaging/MessageAggregator.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/NzbDrone.Core/Messaging/MessageAggregator.cs b/NzbDrone.Core/Messaging/MessageAggregator.cs index 4d3ed0433..499bef32a 100644 --- a/NzbDrone.Core/Messaging/MessageAggregator.cs +++ b/NzbDrone.Core/Messaging/MessageAggregator.cs @@ -166,6 +166,13 @@ namespace NzbDrone.Core.Messaging PublishEvent(new CommandUpdatedEvent(command)); throw; } + finally + { + if (MappedDiagnosticsContext.Get("CommandId") == command.Id.ToString()) + { + MappedDiagnosticsContext.Remove("CommandId"); + } + } PublishEvent(new CommandExecutedEvent(command)); PublishEvent(new CommandUpdatedEvent(command));