mirror of https://github.com/Icinga/icinga2.git
Make sure the check latency can't be negative.
This commit is contained in:
parent
eb20b7e33e
commit
f418db79d7
|
@ -837,5 +837,10 @@ double Service::CalculateLatency(const Dictionary::Ptr& cr)
|
|||
schedule_end = cr->Get("schedule_end");
|
||||
}
|
||||
|
||||
return (schedule_end - schedule_start) - CalculateExecutionTime(cr);
|
||||
double latency = (schedule_end - schedule_start) - CalculateExecutionTime(cr);
|
||||
|
||||
if (latency < 0)
|
||||
latency = 0;
|
||||
|
||||
return latency;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue