]> granicus.if.org Git - icinga2/commitdiff
ido: Fixes for comments.
authorMichael Friedrich <michael.friedrich@netways.de>
Wed, 7 Aug 2013 13:57:35 +0000 (15:57 +0200)
committerMichael Friedrich <michael.friedrich@netways.de>
Wed, 7 Aug 2013 13:57:35 +0000 (15:57 +0200)
refs #4380

lib/icinga/service-comment.cpp
lib/ido/servicedbobject.cpp

index 850835d52567a7b2193f947b9082960066a76eba..874dccaa08bbf48837ec8189e829961867deef2c 100644 (file)
@@ -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)
index 7b8bbd25b321fafcbb2aa358c9c0e7bacb26dc1e..33543e3da10750a63069600ed2158ca1a9976970 100644 (file)
@@ -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<long>(comment->Get("entry_time"));
+               entry_time = static_cast<long>(add_comment->Get("entry_time"));
                entry_time_usec = (add_comment->Get("entry_time") - entry_time) * 1000 * 1000;
 
                fields2 = boost::make_shared<Dictionary>();