Prevent possible concurrency issues in ParallelRequestBuilder
This commit is contained in:
parent
1f70b2fa82
commit
6cf2314ae0
@ -378,14 +378,16 @@ namespace Tapeti.Flow.Default
|
|||||||
if (convergeMethod.Method.DeclaringType != context.HandlerContext.Controller.GetType())
|
if (convergeMethod.Method.DeclaringType != context.HandlerContext.Controller.GetType())
|
||||||
throw new YieldPointException("Converge method must be in the same controller class");
|
throw new YieldPointException("Converge method must be in the same controller class");
|
||||||
|
|
||||||
await Task.WhenAll(requests.Select(requestInfo =>
|
foreach (var requestInfo in requests)
|
||||||
flowProvider.SendRequest(
|
{
|
||||||
|
await flowProvider.SendRequest(
|
||||||
context,
|
context,
|
||||||
requestInfo.Message,
|
requestInfo.Message,
|
||||||
requestInfo.ResponseHandlerInfo,
|
requestInfo.ResponseHandlerInfo,
|
||||||
convergeMethod.Method.Name,
|
convergeMethod.Method.Name,
|
||||||
convergeMethodSync,
|
convergeMethodSync,
|
||||||
false)));
|
false);
|
||||||
|
}
|
||||||
|
|
||||||
await context.Store(requests.Any(i => i.ResponseHandlerInfo.IsDurableQueue));
|
await context.Store(requests.Any(i => i.ResponseHandlerInfo.IsDurableQueue));
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user