Improve CommentHistory

This commit is contained in:
Noah Hilverling 2019-10-30 19:16:52 +01:00 committed by Michael Friedrich
parent 6a7e83a5e6
commit 4e43c766ca
1 changed files with 10 additions and 1 deletions

View File

@ -1485,7 +1485,6 @@ void IcingaDB::SendRemovedComment(const Comment::Ptr& comment)
"entry_type", Convert::ToString(comment->GetEntryType()),
"is_persistent", Convert::ToString((unsigned short)comment->GetPersistent()),
"expire_time", Convert::ToString(TimestampToMilliseconds(comment->GetExpireTime())),
"deletion_time", Convert::ToString(TimestampToMilliseconds(Utility::GetTime())),
"event_id", Utility::NewUniqueID(),
"event_type", "comment_remove"
});
@ -1550,6 +1549,16 @@ void IcingaDB::SendFlappingChanged(const Checkable::Ptr& checkable, const Value&
xAdd.emplace_back(GetObjectIdentifier(endpoint));
}
if (comment->GetExpireTime() < Utility::GetTime()) {
xAdd.emplace_back("remove_time");
xAdd.emplace_back(Convert::ToString(TimestampToMilliseconds(Utility::GetTime())));
xAdd.emplace_back("has_been_removed");
xAdd.emplace_back("1");
} else {
xAdd.emplace_back("has_been_removed");
xAdd.emplace_back("0");
}
m_Rcon->FireAndForgetQuery(std::move(xAdd));
}