refactor: ScadaBridge module options registration -> AddValidatedOptions; clarify De Morgan predicates
This commit is contained in:
@@ -35,6 +35,12 @@ public sealed class HealthMonitoringOptionsValidator : OptionsValidatorBase<Heal
|
||||
$"ScadaBridge:HealthMonitoring:CentralOfflineTimeout must be a positive duration " +
|
||||
$"(was {options.CentralOfflineTimeout}).");
|
||||
|
||||
// Valid when CentralOfflineTimeout >= OfflineTimeout (both already
|
||||
// required to be positive above). The De Morgan'd guard !(both positive
|
||||
// AND Central < Offline) is true unless BOTH timeouts are positive and
|
||||
// Central is strictly smaller — so it stays silent when either field is
|
||||
// non-positive, leaving that failure to the dedicated positive-duration
|
||||
// checks above rather than double-firing here.
|
||||
builder.RequireThat(
|
||||
!(options.OfflineTimeout > TimeSpan.Zero
|
||||
&& options.CentralOfflineTimeout > TimeSpan.Zero
|
||||
|
||||
Reference in New Issue
Block a user