Merge pull request #8768 from Icinga/bugfix/scheduleddowntime-interfer

ScheduledDowntime: ignore not related Downtimes while creating Downtimes
This commit is contained in:
Julian Brost 2021-06-22 15:48:37 +02:00 committed by GitHub
commit fbed8a0463
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -231,12 +231,14 @@ void ScheduledDowntime::CreateNextDowntime()
double minEnd = 0;
for (const Downtime::Ptr& downtime : GetCheckable()->GetDowntimes()) {
if (downtime->GetScheduledBy() != GetName())
continue;
double end = downtime->GetEndTime();
if (end > minEnd)
minEnd = end;
if (downtime->GetScheduledBy() != GetName() ||
downtime->GetStartTime() < Utility::GetTime())
if (downtime->GetStartTime() < Utility::GetTime())
continue;
/* We've found a downtime that is owned by us and that hasn't started yet - we're done. */