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

refs #5033
This commit is contained in:
Michael Friedrich 2017-02-24 15:29:39 +01:00
parent bc486dcef8
commit 0dfe571669
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);
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;