Skip to content

Commit

Permalink
Fixed a bug wherein Restart-Probe wouldn't completely ignore probes t…
Browse files Browse the repository at this point in the history
…hat were already disconnected
  • Loading branch information
lordmilko committed Nov 20, 2017
1 parent b0d14b8 commit a90edb5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7879,7 +7879,7 @@ Describe "Test-Progress" -Tag @("PowerShell", "UnitTest") {
))
}

It "100b2: Variable -> Get-SensorFactorySource | Channel" {
It "100b2: Variable -> Get-SensorFactorySource -> Channel" {

$sensors = Get-Sensor -Count 2

Expand Down
6 changes: 4 additions & 2 deletions PrtgAPI/PowerShell/Cmdlets/ObjectManipulation/RestartProbe.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,11 @@ private void UpdateProbeStatus(List<RestartedProbe> probes, List<Log> logs)
if (logs.Any(log => log.Status == LogStatus.Disconnected && log.Id == probe.Id) || probe.Condition == ProbeStatus.Disconnected)
probe.Disconnected = true;
}
if (probe.Disconnected && !probe.Reconnected)
if (probe.Disconnected && !probe.Reconnected) //If it's already disconnected and hasn't reconnected, check its status
{
if (logs.Any(log => log.Status == LogStatus.Connected && log.Id == probe.Id))
//If the probe has disconnected and we see it's reconnected, flag it as such. If it was already disconnected though,
//it'll never reconnect, so let it through
if (logs.Any(log => log.Status == LogStatus.Connected && log.Id == probe.Id) || probe.Condition == ProbeStatus.Disconnected)
probe.Reconnected = true;
}
}
Expand Down

0 comments on commit a90edb5

Please sign in to comment.