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

Method Start

lib/notification/notificationcomponent.cpp:36–52  ·  view source on GitHub ↗

* Starts the component. */

Source from the content-addressed store, hash-verified

34 * Starts the component.
35 */
36void NotificationComponent::Start(bool runtimeCreated)
37{
38 ObjectImpl<NotificationComponent>::Start(runtimeCreated);
39
40 Log(LogInformation, "NotificationComponent")
41 << "'" << GetName() << "' started.";
42
43 Checkable::OnNotificationsRequested.connect([this](const Checkable::Ptr& checkable, NotificationType type, const CheckResult::Ptr& cr,
44 const String& author, const String& text, const MessageOrigin::Ptr&) {
45 SendNotificationsHandler(checkable, type, cr, author, text);
46 });
47
48 m_NotificationTimer = Timer::Create();
49 m_NotificationTimer->SetInterval(5);
50 m_NotificationTimer->OnTimerExpired.connect([this](const Timer * const&) { NotificationTimerHandler(); });
51 m_NotificationTimer->Start();
52}
53
54void NotificationComponent::Stop(bool runtimeRemoved)
55{

Callers

nothing calls this directly

Calls 2

LogClass · 0.85
SetIntervalMethod · 0.80

Tested by

no test coverage detected