mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-11 07:37:10 -07:00
parent
a602611a5f
commit
a4b78b44ce
1307 changed files with 8702 additions and 7403 deletions
|
@ -11,13 +11,14 @@ namespace NzbDrone.Core.Messaging.Commands
|
|||
public class CommandExecutor : IHandle<ApplicationStartedEvent>,
|
||||
IHandle<ApplicationShutdownRequested>
|
||||
{
|
||||
private const int THREAD_LIMIT = 3;
|
||||
|
||||
private readonly Logger _logger;
|
||||
private readonly IServiceFactory _serviceFactory;
|
||||
private readonly IManageCommandQueue _commandQueueManager;
|
||||
private readonly IEventAggregator _eventAggregator;
|
||||
|
||||
private static CancellationTokenSource _cancellationTokenSource;
|
||||
private const int THREAD_LIMIT = 3;
|
||||
|
||||
public CommandExecutor(IServiceFactory serviceFactory,
|
||||
IManageCommandQueue commandQueueManager,
|
||||
|
@ -53,7 +54,7 @@ namespace NzbDrone.Core.Messaging.Commands
|
|||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
_logger.Trace("Stopped one command execution pipeline");
|
||||
_logger.Trace("Stopped one command execution pipeline");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -61,7 +62,8 @@ namespace NzbDrone.Core.Messaging.Commands
|
|||
}
|
||||
}
|
||||
|
||||
private void ExecuteCommand<TCommand>(TCommand command, CommandModel commandModel) where TCommand : Command
|
||||
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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue