From: Michael Friedrich Date: Thu, 12 Feb 2015 12:18:33 +0000 (+0100) Subject: DB IDO: Fix duplicate entries in scheduleddowntime table X-Git-Tag: v2.3.0~222 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=48fa1a141839c935c85b225549912917a9f179b6;p=icinga2 DB IDO: Fix duplicate entries in scheduleddowntime table fixes #8425 --- diff --git a/lib/db_ido/dbevents.cpp b/lib/db_ido/dbevents.cpp index 3dc6c7a6f..0fbc74835 100644 --- a/lib/db_ido/dbevents.cpp +++ b/lib/db_ido/dbevents.cpp @@ -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); }