From 8a2869999e114c3565f3abd830a95b987fa118e3 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Mon, 12 Aug 2013 11:08:29 +0200 Subject: [PATCH] ido: Restore comments/downtimes on config change. refs #4378 refs #4380 --- lib/ido/servicedbobject.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/ido/servicedbobject.cpp b/lib/ido/servicedbobject.cpp index 2a6f94f2d..fb85f6db5 100644 --- a/lib/ido/servicedbobject.cpp +++ b/lib/ido/servicedbobject.cpp @@ -247,8 +247,9 @@ void ServiceDbObject::OnConfigUpdate(void) } } - /* update comments */ - //OnCommentsChanged(service, Empty, CommentChangedUpdated); + /* update comments and downtimes on config change */ + CommentsChangedHandler(service, Empty, CommentChangedUpdated); + DowntimesChangedHandler(service, Empty, DowntimeChangedUpdated); /* service host config update */ Host::Ptr host = service->GetHost(); @@ -272,6 +273,7 @@ void ServiceDbObject::OnStatusUpdate(void) Service::Ptr service = static_pointer_cast(GetObject()); Host::Ptr host = service->GetHost(); + /* update the host if hostcheck service */ if (!host) return; @@ -290,7 +292,7 @@ void ServiceDbObject::CommentsChangedHandler(const Service::Ptr& svcfilter, cons { if (type == CommentChangedUpdated || type == CommentChangedDeleted) { /* we cannot determine which comment id is deleted - * ido schema does not store legacy id + * id cache may not be in sync */ BOOST_FOREACH(const DynamicObject::Ptr& object, DynamicType::GetObjects("Service")) { Service::Ptr service = static_pointer_cast(object); @@ -433,7 +435,7 @@ void ServiceDbObject::DowntimesChangedHandler(const Service::Ptr& svcfilter, con { if (type == DowntimeChangedUpdated || type == DowntimeChangedDeleted) { /* we cannot determine which downtime id is deleted - * ido schema does not store legacy id + * id cache may not be in sync */ BOOST_FOREACH(const DynamicObject::Ptr& object, DynamicType::GetObjects("Service")) { Service::Ptr service = static_pointer_cast(object);