From c7ad5f6e2e7bb9bfeccc38ec868218d6ae0d31bf Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Wed, 19 May 2021 12:51:31 +0200 Subject: [PATCH] On ScheduledDowntime change: ignore downtimes created before change ... while creating new downtimes. refs #8309 --- lib/icinga/scheduleddowntime.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/icinga/scheduleddowntime.cpp b/lib/icinga/scheduleddowntime.cpp index 93b34a154..9b9b1e941 100644 --- a/lib/icinga/scheduleddowntime.cpp +++ b/lib/icinga/scheduleddowntime.cpp @@ -240,11 +240,16 @@ void ScheduledDowntime::CreateNextDowntime() } double minEnd = 0; + auto downtimeOptionsHash (HashDowntimeOptions()); for (const Downtime::Ptr& downtime : GetCheckable()->GetDowntimes()) { if (downtime->GetScheduledBy() != GetName()) continue; + auto configOwnerHash (downtime->GetConfigOwnerHash()); + if (!configOwnerHash.IsEmpty() && configOwnerHash != downtimeOptionsHash) + continue; + double end = downtime->GetEndTime(); if (end > minEnd) minEnd = end;