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

Method Start

lib/icinga/comment.cpp:78–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76}
77
78void Comment::Start(bool runtimeCreated)
79{
80 ObjectImpl<Comment>::Start(runtimeCreated);
81
82 static boost::once_flag once = BOOST_ONCE_INIT;
83
84 boost::call_once(once, [] {
85 l_CommentsExpireTimer = Timer::Create();
86 l_CommentsExpireTimer->SetInterval(60);
87 l_CommentsExpireTimer->OnTimerExpired.connect([](const Timer * const&) { CommentsExpireTimerHandler(); });
88 l_CommentsExpireTimer->Start();
89 });
90
91 {
92 std::unique_lock<std::mutex> lock(l_CommentMutex);
93
94 SetLegacyId(l_NextCommentID);
95 l_LegacyCommentsCache[l_NextCommentID] = GetName();
96 l_NextCommentID++;
97 }
98
99 GetCheckable()->RegisterComment(this);
100
101 if (runtimeCreated)
102 OnCommentAdded(this);
103}
104
105void Comment::Stop(bool runtimeRemoved)
106{

Callers 2

EnqueueCheckMethod · 0.45
MainMethod · 0.45

Calls 2

SetIntervalMethod · 0.80
RegisterCommentMethod · 0.80

Tested by

no test coverage detected