@@ -90,23 +90,28 @@ void GelfWriter::Resume()
90
90
m_ReconnectTimer->Reschedule (0 );
91
91
92
92
/* Register event handlers. */
93
- Checkable::OnNewCheckResult.connect ([this ](const Checkable::Ptr & checkable, const CheckResult::Ptr & cr, const MessageOrigin::Ptr &) {
93
+ m_HandleCheckResults = Checkable::OnNewCheckResult.connect ([this ](const Checkable::Ptr & checkable,
94
+ const CheckResult::Ptr & cr, const MessageOrigin::Ptr &) {
94
95
CheckResultHandler (checkable, cr);
95
96
});
96
- Checkable::OnNotificationSentToUser.connect ([this ](const Notification::Ptr & notification, const Checkable:: Ptr & checkable ,
97
- const User::Ptr & user, const NotificationType& type, const CheckResult::Ptr & cr, const String& author ,
98
- const String& commentText, const String& commandName, const MessageOrigin::Ptr &) {
97
+ m_HandleNotifications = Checkable::OnNotificationSentToUser.connect ([this ](const Notification::Ptr & notification,
98
+ const Checkable:: Ptr & checkable, const User::Ptr & user, const NotificationType& type, const CheckResult::Ptr & cr,
99
+ const String& author, const String& commentText, const String& commandName, const MessageOrigin::Ptr &) {
99
100
NotificationToUserHandler (notification, checkable, user, type, cr, author, commentText, commandName);
100
101
});
101
- Checkable::OnStateChange.connect ([this ](const Checkable::Ptr & checkable, const CheckResult:: Ptr & cr, StateType type ,
102
- const MessageOrigin::Ptr &) {
102
+ m_HandleStateChanges = Checkable::OnStateChange.connect ([this ](const Checkable::Ptr & checkable,
103
+ const CheckResult:: Ptr & cr, StateType type, const MessageOrigin::Ptr &) {
103
104
StateChangeHandler (checkable, cr, type);
104
105
});
105
106
}
106
107
107
108
/* Pause is equivalent to Stop, but with HA capabilities to resume at runtime. */
108
109
void GelfWriter::Pause ()
109
110
{
111
+ m_HandleCheckResults.disconnect ();
112
+ m_HandleNotifications.disconnect ();
113
+ m_HandleStateChanges.disconnect ();
114
+
110
115
m_ReconnectTimer.reset ();
111
116
112
117
try {
0 commit comments