DB IDO: Fix duplicate entries in scheduleddowntime table

fixes #8425
This commit is contained in:
Michael Friedrich 2015-02-12 13:18:33 +01:00
parent 9d97094390
commit 48fa1a1418
1 changed files with 5 additions and 0 deletions

View File

@ -475,6 +475,11 @@ void DbEvents::AddDowntimes(const Checkable::Ptr& checkable)
void DbEvents::AddDowntime(const Checkable::Ptr& checkable, const Downtime::Ptr& downtime)
{
/*
* make sure to delete any old downtime to avoid multiple inserts from
* configured ScheduledDowntime dumps and CreateNextDowntime() calls
*/
RemoveDowntime(checkable, downtime);
AddDowntimeInternal(checkable, downtime, false);
}