MCPcopy Create free account
hub / github.com/Icinga/icinga2 / CommentsExpireTimerHandler

Method CommentsExpireTimerHandler

lib/icinga/comment.cpp:240–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

238}
239
240void Comment::CommentsExpireTimerHandler()
241{
242 std::vector<Comment::Ptr> comments;
243
244 for (const Comment::Ptr& comment : ConfigType::GetObjectsByType<Comment>()) {
245 comments.push_back(comment);
246 }
247
248 for (const Comment::Ptr& comment : comments) {
249 /* Only remove comments which are activated after daemon start. */
250 if (comment->IsActive() && comment->IsExpired()) {
251 /* Do not remove persistent comments from an acknowledgement */
252 if (comment->GetEntryType() == CommentAcknowledgement && comment->GetPersistent())
253 continue;
254
255 RemoveComment(comment->GetName());
256 }
257 }
258}

Callers

nothing calls this directly

Calls 4

push_backMethod · 0.80
IsActiveMethod · 0.80
IsExpiredMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected