From 0dfe571669bb2884b7e55e6abf10d74a3130d5b3 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Fri, 24 Feb 2017 15:29:39 +0100 Subject: [PATCH] DB IDO: Fix actual_end_time update for non-triggered flexible downtimes refs #5033 --- lib/db_ido/dbevents.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/db_ido/dbevents.cpp b/lib/db_ido/dbevents.cpp index 9da40139b..32fdf04d1 100644 --- a/lib/db_ido/dbevents.cpp +++ b/lib/db_ido/dbevents.cpp @@ -601,8 +601,12 @@ void DbEvents::RemoveDowntimeInternal(std::vector& queries, const Downt Dictionary::Ptr fields3 = new Dictionary(); fields3->Set("was_cancelled", downtime->GetWasCancelled() ? 1 : 0); - fields3->Set("actual_end_time", DbValue::FromTimestamp(time_bag.first)); - fields3->Set("actual_end_time_usec", time_bag.second); + + if (downtime->GetFixed() || (!downtime->GetFixed() && downtime->GetTriggerTime() > 0)) { + fields3->Set("actual_end_time", DbValue::FromTimestamp(time_bag.first)); + fields3->Set("actual_end_time_usec", time_bag.second); + } + fields3->Set("is_in_effect", 0); query3.Fields = fields3;