mirror of
https://github.com/lidarr/Lidarr
synced 2025-01-03 05:25:10 +00:00
Fixed: Broken tasks getting stuck in queue
This commit is contained in:
parent
c8d8394347
commit
b7aa945eae
1 changed files with 11 additions and 6 deletions
|
@ -65,13 +65,15 @@ private void ExecuteCommands()
|
|||
private void ExecuteCommand<TCommand>(TCommand command, CommandModel commandModel)
|
||||
where TCommand : Command
|
||||
{
|
||||
var handlerContract = typeof(IExecute<>).MakeGenericType(command.GetType());
|
||||
var handler = (IExecute<TCommand>)_serviceFactory.Build(handlerContract);
|
||||
|
||||
_logger.Trace("{0} -> {1}", command.GetType().Name, handler.GetType().Name);
|
||||
IExecute<TCommand> handler = null;
|
||||
|
||||
try
|
||||
{
|
||||
var handlerContract = typeof(IExecute<>).MakeGenericType(command.GetType());
|
||||
handler = (IExecute<TCommand>)_serviceFactory.Build(handlerContract);
|
||||
|
||||
_logger.Trace("{0} -> {1}", command.GetType().Name, handler.GetType().Name);
|
||||
|
||||
_commandQueueManager.Start(commandModel);
|
||||
BroadcastCommandUpdate(commandModel);
|
||||
|
||||
|
@ -106,9 +108,12 @@ private void ExecuteCommand<TCommand>(TCommand command, CommandModel commandMode
|
|||
{
|
||||
ProgressMessageContext.CommandModel = null;
|
||||
}
|
||||
}
|
||||
|
||||
_logger.Trace("{0} <- {1} [{2}]", command.GetType().Name, handler.GetType().Name, commandModel.Duration.ToString());
|
||||
if (handler != null)
|
||||
{
|
||||
_logger.Trace("{0} <- {1} [{2}]", command.GetType().Name, handler.GetType().Name, commandModel.Duration.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void BroadcastCommandUpdate(CommandModel command)
|
||||
|
|
Loading…
Reference in a new issue