diff --git a/lib/icinga/service-comment.cpp b/lib/icinga/service-comment.cpp index 850835d52..874dccaa0 100644 --- a/lib/icinga/service-comment.cpp +++ b/lib/icinga/service-comment.cpp @@ -250,8 +250,6 @@ void Service::RefreshCommentsCache(void) l_CommentsExpireTimer->OnTimerExpired.connect(boost::bind(&Service::CommentsExpireTimerHandler)); l_CommentsExpireTimer->Start(); } - - OnCommentsChanged(Service::Ptr(), Empty, CommentChangedUpdated); } void Service::RemoveCommentsByType(int type) diff --git a/lib/ido/servicedbobject.cpp b/lib/ido/servicedbobject.cpp index 7b8bbd25b..33543e3da 100644 --- a/lib/ido/servicedbobject.cpp +++ b/lib/ido/servicedbobject.cpp @@ -204,6 +204,9 @@ void ServiceDbObject::OnConfigUpdate(void) OnQuery(query1); } + /* update comments */ + OnCommentsChanged(service, Empty, CommentChangedUpdated); + /* service host config update */ Host::Ptr host = service->GetHost(); @@ -344,7 +347,7 @@ void ServiceDbObject::CommentsChangedHandler(const Service::Ptr& svcfilter, cons /* newly added comment */ Log(LogDebug, "ido", "adding service comment (id = " + id + ") for '" + service->GetName() + "'"); - entry_time = static_cast(comment->Get("entry_time")); + entry_time = static_cast(add_comment->Get("entry_time")); entry_time_usec = (add_comment->Get("entry_time") - entry_time) * 1000 * 1000; fields2 = boost::make_shared();