mirror of https://github.com/Icinga/icinga2.git
fix bug in Downtime::IsInEffect() method that would always return false if the triggering window for a flexible downtime had passed
This commit is contained in:
parent
f2ce5b549c
commit
3f75ccbe75
|
@ -158,16 +158,15 @@ bool Downtime::IsInEffect() const
|
||||||
{
|
{
|
||||||
double now = Utility::GetTime();
|
double now = Utility::GetTime();
|
||||||
|
|
||||||
if (now < GetStartTime() ||
|
if (GetFixed()) {
|
||||||
now > GetEndTime())
|
/* fixed downtimes are in effect during the entire [start..end) interval */
|
||||||
return false;
|
return (now >= GetStartTime() && now < GetEndTime());
|
||||||
|
}
|
||||||
if (GetFixed())
|
|
||||||
return true;
|
|
||||||
|
|
||||||
double triggerTime = GetTriggerTime();
|
double triggerTime = GetTriggerTime();
|
||||||
|
|
||||||
if (triggerTime == 0)
|
if (triggerTime == 0)
|
||||||
|
/* flexible downtime has not been triggered yet */
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return (now < triggerTime + GetDuration());
|
return (now < triggerTime + GetDuration());
|
||||||
|
|
Loading…
Reference in New Issue