mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-27 23:54:07 +02:00
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;
|
String id;
|
||||||
BOOST_FOREACH(boost::tie(id, boost::tuples::ignore), comments) {
|
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;
|
String id;
|
||||||
BOOST_FOREACH(boost::tie(id, boost::tuples::ignore), downtimes) {
|
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");
|
Touch("comments");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
boost::mutex::scoped_lock lock(l_CommentMutex);
|
||||||
|
l_CommentsCache[id] = GetSelf();
|
||||||
|
}
|
||||||
|
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,6 +126,11 @@ String Service::AddDowntime(const String& author, const String& comment,
|
|||||||
|
|
||||||
(void) AddComment(CommentDowntime, author, comment, endTime);
|
(void) AddComment(CommentDowntime, author, comment, endTime);
|
||||||
|
|
||||||
|
{
|
||||||
|
boost::mutex::scoped_lock lock(l_DowntimeMutex);
|
||||||
|
l_DowntimesCache[id] = GetSelf();
|
||||||
|
}
|
||||||
|
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user