mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-21 22:04:31 -04:00
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user