Browse Source

add failed message processor.

master
Savorboard 7 years ago
parent
commit
8e41e0d552
1 changed files with 3 additions and 6 deletions
  1. +3
    -6
      src/DotNetCore.CAP/Processor/IProcessingServer.Cap.cs

+ 3
- 6
src/DotNetCore.CAP/Processor/IProcessingServer.Cap.cs View File

@@ -47,7 +47,7 @@ namespace DotNetCore.CAP.Processor
_context = new ProcessingContext(_provider, _cts.Token); _context = new ProcessingContext(_provider, _cts.Token);


var processorTasks = _processors var processorTasks = _processors
.Select(p => InfiniteRetry(p))
.Select(InfiniteRetry)
.Select(p => p.ProcessAsync(_context)); .Select(p => p.ProcessAsync(_context));
_compositeTask = Task.WhenAll(processorTasks); _compositeTask = Task.WhenAll(processorTasks);
} }
@@ -84,10 +84,7 @@ namespace DotNetCore.CAP.Processor


private bool AllProcessorsWaiting() private bool AllProcessorsWaiting()
{ {
foreach (var processor in _messageDispatchers)
if (!processor.Waiting)
return false;
return true;
return _messageDispatchers.All(processor => processor.Waiting);
} }


private IProcessor InfiniteRetry(IProcessor inner) private IProcessor InfiniteRetry(IProcessor inner)
@@ -107,7 +104,7 @@ namespace DotNetCore.CAP.Processor


returnedProcessors.Add(_provider.GetRequiredService<PublishQueuer>()); returnedProcessors.Add(_provider.GetRequiredService<PublishQueuer>());
returnedProcessors.Add(_provider.GetRequiredService<SubscribeQueuer>()); returnedProcessors.Add(_provider.GetRequiredService<SubscribeQueuer>());
//returnedProcessors.Add(_provider.GetRequiredService<FailedJobProcessor>());
returnedProcessors.Add(_provider.GetRequiredService<FailedProcessor>());


returnedProcessors.Add(_provider.GetRequiredService<IAdditionalProcessor>()); returnedProcessors.Add(_provider.GetRequiredService<IAdditionalProcessor>());




Loading…
Cancel
Save