feat(runtime): per-script execution timeout overriding the global default (#9)
Spec promised a per-script timeout but only the global ScriptExecutionTimeoutSeconds existed. Add nullable TemplateScript.ExecutionTimeoutSeconds threaded through EF + flattening (ResolvedScript) to ScriptExecutionActor/AlarmExecutionActor, which use perScript ?? global for the execution CTS. Includes the EF migration for the new column.
This commit is contained in:
@@ -141,7 +141,8 @@ public class DiffService
|
||||
a.TriggerConfiguration == b.TriggerConfiguration &&
|
||||
a.ParameterDefinitions == b.ParameterDefinitions &&
|
||||
a.ReturnDefinition == b.ReturnDefinition &&
|
||||
a.MinTimeBetweenRuns == b.MinTimeBetweenRuns;
|
||||
a.MinTimeBetweenRuns == b.MinTimeBetweenRuns &&
|
||||
a.ExecutionTimeoutSeconds == b.ExecutionTimeoutSeconds;
|
||||
|
||||
/// <summary>
|
||||
/// Compares two <see cref="ConnectionConfig"/> instances for equality across
|
||||
|
||||
@@ -830,6 +830,10 @@ public class FlatteningService
|
||||
ParameterDefinitions = script.ParameterDefinitions,
|
||||
ReturnDefinition = script.ReturnDefinition,
|
||||
MinTimeBetweenRuns = script.MinTimeBetweenRuns,
|
||||
// M2.5 (#9): per-script timeout rides along on the winning row.
|
||||
// Scripts inherit/override at whole-row granularity (no per-field
|
||||
// merge), so this follows the same rule as the script body/MinTime.
|
||||
ExecutionTimeoutSeconds = script.ExecutionTimeoutSeconds,
|
||||
Source = source
|
||||
};
|
||||
idByName[script.Name] = script.Id;
|
||||
|
||||
@@ -83,7 +83,10 @@ public class RevisionHashService
|
||||
TriggerConfiguration = s.TriggerConfiguration,
|
||||
ParameterDefinitions = s.ParameterDefinitions,
|
||||
ReturnDefinition = s.ReturnDefinition,
|
||||
MinTimeBetweenRunsTicks = s.MinTimeBetweenRuns?.Ticks
|
||||
MinTimeBetweenRunsTicks = s.MinTimeBetweenRuns?.Ticks,
|
||||
// M2.5 (#9): include the per-script timeout so a change to it
|
||||
// is detected as a configuration change (staleness/redeploy).
|
||||
ExecutionTimeoutSeconds = s.ExecutionTimeoutSeconds
|
||||
})
|
||||
.ToList(),
|
||||
Connections = configuration.Connections is { Count: > 0 }
|
||||
@@ -244,6 +247,10 @@ public class RevisionHashService
|
||||
/// </summary>
|
||||
public string Code { get; init; } = string.Empty;
|
||||
/// <summary>
|
||||
/// M2.5 (#9): the per-script execution timeout in seconds (null = global).
|
||||
/// </summary>
|
||||
public int? ExecutionTimeoutSeconds { get; init; }
|
||||
/// <summary>
|
||||
/// Whether the script is locked.
|
||||
/// </summary>
|
||||
public bool IsLocked { get; init; }
|
||||
|
||||
Reference in New Issue
Block a user