|
|
|
@ -64,14 +64,16 @@ namespace NzbDrone.Core.Messaging.Commands
|
|
|
|
|
|
|
|
|
|
private void ExecuteCommand<TCommand>(TCommand command, CommandModel commandModel)
|
|
|
|
|
where TCommand : Command
|
|
|
|
|
{
|
|
|
|
|
IExecute<TCommand> handler = null;
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
var handlerContract = typeof(IExecute<>).MakeGenericType(command.GetType());
|
|
|
|
|
var handler = (IExecute<TCommand>)_serviceFactory.Build(handlerContract);
|
|
|
|
|
handler = (IExecute<TCommand>)_serviceFactory.Build(handlerContract);
|
|
|
|
|
|
|
|
|
|
_logger.Trace("{0} -> {1}", command.GetType().Name, handler.GetType().Name);
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
_commandQueueManager.Start(commandModel);
|
|
|
|
|
BroadcastCommandUpdate(commandModel);
|
|
|
|
|
|
|
|
|
@ -106,10 +108,13 @@ namespace NzbDrone.Core.Messaging.Commands
|
|
|
|
|
{
|
|
|
|
|
ProgressMessageContext.CommandModel = null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (handler != null)
|
|
|
|
|
{
|
|
|
|
|
_logger.Trace("{0} <- {1} [{2}]", command.GetType().Name, handler.GetType().Name, commandModel.Duration.ToString());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void BroadcastCommandUpdate(CommandModel command)
|
|
|
|
|
{
|
|
|
|
|