feat(centralui): execution-chain tree view on the Audit Log page
This commit is contained in:
@@ -132,4 +132,23 @@ public sealed class AuditLogQueryService : IAuditLogQueryService
|
||||
|
||||
return repoSnapshot with { BacklogTotal = backlog };
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public async Task<IReadOnlyList<ExecutionTreeNode>> GetExecutionTreeAsync(
|
||||
Guid executionId,
|
||||
CancellationToken ct = default)
|
||||
{
|
||||
// Test-seam ctor: use the injected repository directly.
|
||||
if (_injectedRepository is not null)
|
||||
{
|
||||
return await _injectedRepository.GetExecutionTreeAsync(executionId, ct);
|
||||
}
|
||||
|
||||
// Production: a fresh scope (and thus a fresh DbContext) per call — the
|
||||
// same context-isolation contract QueryAsync upholds, so the tree
|
||||
// page's auto-load never shares the circuit-scoped context.
|
||||
await using var scope = _scopeFactory!.CreateAsyncScope();
|
||||
var repository = scope.ServiceProvider.GetRequiredService<IAuditLogRepository>();
|
||||
return await repository.GetExecutionTreeAsync(executionId, ct);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user