Exemple #1
0
 private void ExecuteCommands()
 {
     try
     {
         foreach (var command in _commandQueueManager.Queue(_cancellationTokenSource.Token))
         {
             try
             {
                 ExecuteCommand((dynamic)command.Body, command);
             }
             catch (Exception ex)
             {
                 _logger.Error(ex, "Error occurred while executing task {0}", command.Name);
             }
         }
     }
     catch (ThreadAbortException ex)
     {
         _logger.Error(ex, "Thread aborted");
         Thread.ResetAbort();
     }
     catch (OperationCanceledException)
     {
         _logger.Trace("Stopped one command execution pipeline");
     }
     catch (Exception ex)
     {
         _logger.Error(ex, "Unknown error in thread");
     }
 }
Exemple #2
0
 private void ExecuteCommands()
 {
     try
     {
         foreach (var command in _commandQueueManager.Queue(_cancellationTokenSource.Token))
         {
             try
             {
                 ExecuteCommand((dynamic)command.Body, command);
             }
             catch (Exception ex)
             {
                 _logger.Error(ex, "Error occurred while executing task " + command.Name);
             }
         }
     }
     catch (ThreadAbortException ex)
     {
         _logger.Error(ex, "Thread aborted: " + ex.Message);
         Thread.ResetAbort();
     }
     catch (Exception ex)
     {
         _logger.Error(ex, "Unknown error in thread: " + ex.Message);
     }
 }