Merge branch 'hotfix/2.0.3'
This commit is contained in:
commit
8607c2b2c2
@ -9,5 +9,12 @@
|
||||
/// Key given to the FlowContext object as stored in the message context.
|
||||
/// </summary>
|
||||
public const string FlowContext = "Tapeti.Flow.FlowContext";
|
||||
|
||||
/// <summary>
|
||||
/// Indicates if the current message handler is the last one to be called before a
|
||||
/// parallel flow is done and the convergeMethod will be called.
|
||||
/// Temporarily disables storing the flow state.
|
||||
/// </summary>
|
||||
public const string FlowIsConverging = "Tapeti.Flow.IsConverging";
|
||||
}
|
||||
}
|
||||
|
@ -83,6 +83,9 @@ namespace Tapeti.Flow.Default
|
||||
|
||||
private static Task HandleParallelResponse(IControllerMessageContext context)
|
||||
{
|
||||
if (context.Get<object>(ContextItems.FlowIsConverging, out _))
|
||||
return Task.CompletedTask;
|
||||
|
||||
var flowHandler = context.Config.DependencyResolver.Resolve<IFlowHandler>();
|
||||
return flowHandler.Execute(new FlowHandlerContext(context), new DelegateYieldPoint(async flowContext =>
|
||||
{
|
||||
|
@ -36,6 +36,10 @@ namespace Tapeti.Flow.Default
|
||||
var converge = flowContext.FlowState.Continuations.Count == 0 &&
|
||||
flowContext.ContinuationMetadata.ConvergeMethodName != null;
|
||||
|
||||
if (converge)
|
||||
// Indicate to the FlowBindingMiddleware that the state must not to be stored
|
||||
context.Store(ContextItems.FlowIsConverging, null);
|
||||
|
||||
await next();
|
||||
|
||||
if (converge)
|
||||
@ -57,6 +61,7 @@ namespace Tapeti.Flow.Default
|
||||
|
||||
if (flowContext?.FlowStateLock != null)
|
||||
{
|
||||
// TODO do not call when the controller method was filtered, if the same message has two methods
|
||||
if (!flowContext.IsStoredOrDeleted())
|
||||
// The exception strategy can set the consume result to Success. Instead, check if the yield point
|
||||
// was handled. The flow provider ensures we only end up here in case of an exception.
|
||||
|
Loading…
Reference in New Issue
Block a user