Prevent ProgressMessageTarget from ever reading the command from the database.

This commit is contained in:
Taloth Saldono 2015-06-03 20:17:50 +02:00
parent 6d18b37a94
commit 866f971d41
6 changed files with 52 additions and 39 deletions

View file

@ -69,9 +69,9 @@ namespace NzbDrone.Core.Messaging.Commands
_commandQueueManager.Start(commandModel);
BroadcastCommandUpdate(commandModel);
if (!MappedDiagnosticsContext.Contains("CommandId"))
if (ProgressMessageContext.CommandModel == null)
{
MappedDiagnosticsContext.Set("CommandId", commandModel.Id.ToString());
ProgressMessageContext.CommandModel = commandModel;
}
handler.Execute(command);
@ -96,9 +96,9 @@ namespace NzbDrone.Core.Messaging.Commands
_eventAggregator.PublishEvent(new CommandExecutedEvent(commandModel));
if (MappedDiagnosticsContext.Get("CommandId") == commandModel.Id.ToString())
if (ProgressMessageContext.CommandModel == commandModel)
{
MappedDiagnosticsContext.Remove("CommandId");
ProgressMessageContext.CommandModel = null;
}
}