Merge pull request #5034 from Icinga/fix/ido-downtime-end-5033

DB IDO: Fix actual_end_time update for non-triggered flexible downtimes

fixes #5033
This commit is contained in:
Michael Friedrich 2017-02-24 15:31:12 +01:00 committed by GitHub
commit a63a1882a1
1 changed files with 6 additions and 2 deletions

View File

@ -601,8 +601,12 @@ void DbEvents::RemoveDowntimeInternal(std::vector<DbQuery>& 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;