mirror of
https://github.com/fergalmoran/DnsServer.git
synced 2026-01-07 09:14:02 +00:00
Failover.HealthService: updated Initialize() to set maintenance status immediately for health monitors.
This commit is contained in:
@@ -342,7 +342,24 @@ namespace Failover
|
||||
else
|
||||
enabled = true;
|
||||
|
||||
_underMaintenance.TryAdd(NetworkAddress.Parse(network), enabled);
|
||||
NetworkAddress umNetwork = NetworkAddress.Parse(network);
|
||||
|
||||
if (_underMaintenance.TryAdd(umNetwork, enabled))
|
||||
{
|
||||
if (enabled)
|
||||
{
|
||||
foreach (KeyValuePair<string, HealthMonitor> healthMonitor in _healthMonitors)
|
||||
{
|
||||
HealthMonitor monitor = healthMonitor.Value;
|
||||
|
||||
if (monitor.Address is null)
|
||||
continue;
|
||||
|
||||
if (umNetwork.Contains(monitor.Address))
|
||||
monitor.SetUnderMaintenance();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user