up
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
namespace StellaOps.Policy.Engine.Options;
|
||||
|
||||
/// <summary>
|
||||
/// Options controlling the exception activation/expiry lifecycle worker.
|
||||
/// </summary>
|
||||
public sealed class PolicyEngineExceptionLifecycleOptions
|
||||
{
|
||||
/// <summary>Polling interval for lifecycle checks.</summary>
|
||||
public int PollIntervalSeconds { get; set; } = 60;
|
||||
|
||||
/// <summary>How far back to look when picking up overdue activations.</summary>
|
||||
public int ActivationLookbackMinutes { get; set; } = 5;
|
||||
|
||||
/// <summary>How far back to look when expiring exceptions.</summary>
|
||||
public int ExpiryLookbackMinutes { get; set; } = 5;
|
||||
|
||||
/// <summary>How far ahead to look for upcoming expirations.</summary>
|
||||
public int ExpiryHorizonMinutes { get; set; } = 5;
|
||||
|
||||
/// <summary>Maximum exceptions processed per cycle.</summary>
|
||||
public int MaxBatchSize { get; set; } = 500;
|
||||
|
||||
public void Validate()
|
||||
{
|
||||
if (PollIntervalSeconds <= 0)
|
||||
{
|
||||
throw new InvalidOperationException("Exception lifecycle poll interval must be greater than zero.");
|
||||
}
|
||||
|
||||
if (ActivationLookbackMinutes < 0 || ExpiryLookbackMinutes < 0 || ExpiryHorizonMinutes < 0)
|
||||
{
|
||||
throw new InvalidOperationException("Exception lifecycle windows cannot be negative.");
|
||||
}
|
||||
|
||||
if (MaxBatchSize <= 0)
|
||||
{
|
||||
throw new InvalidOperationException("Exception lifecycle batch size must be greater than zero.");
|
||||
}
|
||||
}
|
||||
|
||||
public TimeSpan PollInterval => TimeSpan.FromSeconds(PollIntervalSeconds);
|
||||
public TimeSpan ActivationLookback => TimeSpan.FromMinutes(ActivationLookbackMinutes);
|
||||
public TimeSpan ExpiryLookback => TimeSpan.FromMinutes(ExpiryLookbackMinutes);
|
||||
public TimeSpan ExpiryHorizon => TimeSpan.FromMinutes(ExpiryHorizonMinutes);
|
||||
}
|
||||
@@ -33,11 +33,13 @@ public sealed class PolicyEngineOptions
|
||||
|
||||
public ReachabilityFactsCacheOptions ReachabilityCache { get; } = new();
|
||||
|
||||
public PolicyEvaluationCacheOptions EvaluationCache { get; } = new();
|
||||
|
||||
public EffectiveDecisionMapOptions EffectiveDecisionMap { get; } = new();
|
||||
|
||||
public ExceptionCacheOptions ExceptionCache { get; } = new();
|
||||
public PolicyEvaluationCacheOptions EvaluationCache { get; } = new();
|
||||
|
||||
public EffectiveDecisionMapOptions EffectiveDecisionMap { get; } = new();
|
||||
|
||||
public ExceptionCacheOptions ExceptionCache { get; } = new();
|
||||
|
||||
public PolicyEngineExceptionLifecycleOptions ExceptionLifecycle { get; } = new();
|
||||
|
||||
public void Validate()
|
||||
{
|
||||
@@ -45,12 +47,13 @@ public sealed class PolicyEngineOptions
|
||||
Storage.Validate();
|
||||
Workers.Validate();
|
||||
ResourceServer.Validate();
|
||||
Compilation.Validate();
|
||||
Activation.Validate();
|
||||
Telemetry.Validate();
|
||||
RiskProfile.Validate();
|
||||
}
|
||||
}
|
||||
Compilation.Validate();
|
||||
Activation.Validate();
|
||||
Telemetry.Validate();
|
||||
RiskProfile.Validate();
|
||||
ExceptionLifecycle.Validate();
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class PolicyEngineAuthorityOptions
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user