DB IDO: Ensure to delete outdated comments/downtimes for host/service objects

fixes #11688
This commit is contained in:
Michael Friedrich 2016-06-03 14:40:37 +02:00
parent 88dff68567
commit 0ce41399e0
1 changed files with 5 additions and 5 deletions

View File

@ -303,11 +303,11 @@ void DbEvents::AddComments(const Checkable::Ptr& checkable)
{ {
std::set<Comment::Ptr> comments = checkable->GetComments(); std::set<Comment::Ptr> comments = checkable->GetComments();
if (comments.empty())
return;
std::vector<DbQuery> queries; std::vector<DbQuery> queries;
/* Ensure to delete all comments and then insert any or none.
* We must purge obsolete comments in the database at all cost. */
DbQuery query1; DbQuery query1;
query1.Table = "comments"; query1.Table = "comments";
query1.Type = DbQueryDelete; query1.Type = DbQueryDelete;
@ -442,8 +442,8 @@ void DbEvents::AddDowntimes(const Checkable::Ptr& checkable)
{ {
std::set<Downtime::Ptr> downtimes = checkable->GetDowntimes(); std::set<Downtime::Ptr> downtimes = checkable->GetDowntimes();
if (downtimes.empty()) /* Ensure to delete all downtimes and then insert any or none.
return; * We must purge obsolete downtimes in the database at all cost. */
std::vector<DbQuery> queries; std::vector<DbQuery> queries;