feat(inboundapi): mint inbound ExecutionId early, carry it as RouteToCallRequest.ParentExecutionId
This commit is contained in:
@@ -92,8 +92,21 @@ public static class EndpointExtensions
|
||||
? TimeSpan.FromSeconds(method.TimeoutSeconds)
|
||||
: options.DefaultMethodTimeout;
|
||||
|
||||
// Audit Log #23 (ParentExecutionId): the inbound request's per-request
|
||||
// ExecutionId was minted early by AuditWriteMiddleware and stashed on
|
||||
// HttpContext.Items. Thread it into the executor so a routed
|
||||
// Route.To(...).Call(...) carries it as RouteToCallRequest.ParentExecutionId
|
||||
// — the spawned site script execution points back at this inbound request.
|
||||
var parentExecutionId =
|
||||
httpContext.Items.TryGetValue(
|
||||
AuditWriteMiddleware.InboundExecutionIdItemKey, out var stashedExecutionId)
|
||||
&& stashedExecutionId is Guid inboundExecutionId
|
||||
? inboundExecutionId
|
||||
: (Guid?)null;
|
||||
|
||||
var scriptResult = await executor.ExecuteAsync(
|
||||
method, paramResult.Parameters, routeHelper, timeout, httpContext.RequestAborted);
|
||||
method, paramResult.Parameters, routeHelper, timeout,
|
||||
httpContext.RequestAborted, parentExecutionId);
|
||||
|
||||
if (!scriptResult.Success)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user