feat(siteruntime): thread ParentExecutionId into the routed script's ScriptRuntimeContext
This commit is contained in:
@@ -184,7 +184,13 @@ public class ScriptActor : ReceiveActor, IWithTimers
|
||||
return;
|
||||
}
|
||||
|
||||
SpawnExecution(request.Parameters, request.CurrentCallDepth, Sender, request.CorrelationId);
|
||||
// Audit Log #23 (ParentExecutionId): carry any inbound-routed
|
||||
// ParentExecutionId through to the ScriptExecutionActor so the routed
|
||||
// script's ScriptRuntimeContext can record its spawner. Null for normal
|
||||
// (tag-change / timer) runs and nested Script.Call invocations.
|
||||
SpawnExecution(
|
||||
request.Parameters, request.CurrentCallDepth, Sender, request.CorrelationId,
|
||||
request.ParentExecutionId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -379,7 +385,8 @@ public class ScriptActor : ReceiveActor, IWithTimers
|
||||
IReadOnlyDictionary<string, object?>? parameters,
|
||||
int callDepth,
|
||||
IActorRef replyTo,
|
||||
string correlationId)
|
||||
string correlationId,
|
||||
Guid? parentExecutionId = null)
|
||||
{
|
||||
var executionId = $"{_scriptName}-exec-{_executionCounter++}";
|
||||
|
||||
@@ -401,7 +408,10 @@ public class ScriptActor : ReceiveActor, IWithTimers
|
||||
_logger,
|
||||
_scope,
|
||||
_healthCollector,
|
||||
_serviceProvider));
|
||||
_serviceProvider,
|
||||
// Audit Log #23 (ParentExecutionId): null for trigger-driven runs;
|
||||
// an inbound-API-routed call supplies the inbound request's id.
|
||||
parentExecutionId));
|
||||
|
||||
Context.ActorOf(props, executionId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user