diff --git a/lib/db_ido/servicedbobject.cpp b/lib/db_ido/servicedbobject.cpp index fe23f8c30..b9a5cd7d5 100644 --- a/lib/db_ido/servicedbobject.cpp +++ b/lib/db_ido/servicedbobject.cpp @@ -327,6 +327,9 @@ void ServiceDbObject::AddComments(const Service::Ptr& service) ObjectLock olock(comments); + if (comments->GetLength() > 0) + RemoveComments(service); + BOOST_FOREACH(const Dictionary::Pair& kv, comments) { AddComment(service, kv.second); } @@ -489,6 +492,9 @@ void ServiceDbObject::AddDowntimes(const Service::Ptr& service) ObjectLock olock(downtimes); + if (downtimes->GetLength() > 0) + RemoveDowntimes(service); + BOOST_FOREACH(const Dictionary::Pair& kv, downtimes) { AddDowntime(service, kv.second); }