From bcc3870f3accd39d222a9170183e97e669b15732 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 282700a83..8b7c87f1e 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;