Make sure that the scheduled start time for downtimes isn't ignored

fixes #6959
This commit is contained in:
Gunnar Beutner 2015-02-25 15:18:35 +01:00
parent a026d47454
commit c86b17132c
1 changed files with 8 additions and 0 deletions

View File

@ -201,6 +201,14 @@ void Checkable::TriggerDowntime(const String& id)
return;
}
double now = Utility::GetTime();
if (now < downtime->GetStartTime() && now > downtime->GetEndTime()) {
Log(LogDebug, "Checkable")
<< "Not triggering downtime with ID '" << downtime->GetLegacyId() << "': current time is outside downtime window.";
return;
}
Log(LogNotice, "Checkable")
<< "Triggering downtime with ID '" << downtime->GetLegacyId() << "'.";