mirror of https://github.com/Icinga/icinga2.git
Make sure new comments/downtimes are added to the ID cache right away.
This commit is contained in:
parent
033389d243
commit
540e63c157
|
@ -69,7 +69,8 @@ void CommentsTable::FetchRows(const AddRowFunction& addRowFn)
|
|||
|
||||
String id;
|
||||
BOOST_FOREACH(boost::tie(id, boost::tuples::ignore), comments) {
|
||||
addRowFn(id);
|
||||
if (Service::GetOwnerByCommentID(id) == service)
|
||||
addRowFn(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -69,7 +69,8 @@ void DowntimesTable::FetchRows(const AddRowFunction& addRowFn)
|
|||
|
||||
String id;
|
||||
BOOST_FOREACH(boost::tie(id, boost::tuples::ignore), downtimes) {
|
||||
addRowFn(id);
|
||||
if (Service::GetOwnerByDowntimeID(id) == service)
|
||||
addRowFn(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -90,6 +90,11 @@ String Service::AddComment(CommentType entryType, const String& author,
|
|||
Touch("comments");
|
||||
}
|
||||
|
||||
{
|
||||
boost::mutex::scoped_lock lock(l_CommentMutex);
|
||||
l_CommentsCache[id] = GetSelf();
|
||||
}
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
|
|
|
@ -126,6 +126,11 @@ String Service::AddDowntime(const String& author, const String& comment,
|
|||
|
||||
(void) AddComment(CommentDowntime, author, comment, endTime);
|
||||
|
||||
{
|
||||
boost::mutex::scoped_lock lock(l_DowntimeMutex);
|
||||
l_DowntimesCache[id] = GetSelf();
|
||||
}
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue