]> granicus.if.org Git - icinga2/commitdiff
Fix that custom notifications do not reset force_next_notification
authorMichael Friedrich <michael.friedrich@icinga.com>
Thu, 17 Nov 2016 10:46:40 +0000 (11:46 +0100)
committerMichael Friedrich <michael.friedrich@icinga.com>
Thu, 17 Nov 2016 10:53:35 +0000 (11:53 +0100)
This attribute is stored in the state file forever as well.
Will cause forced notifications ignoring state/type filters.

fixes #12670

lib/icinga/checkable-notification.cpp

index ac7761652617ae96a7fcf9cf0ae811a0609de55d..a9c804a7af8e7ddab5be74c2b32f76f52cea7194 100644 (file)
@@ -48,14 +48,14 @@ void Checkable::SendNotifications(NotificationType type, const CheckResult::Ptr&
 
        bool force = GetForceNextNotification();
 
+       SetForceNextNotification(false);
+
        if (!IcingaApplication::GetInstance()->GetEnableNotifications() || !GetEnableNotifications()) {
                if (!force) {
                        Log(LogInformation, "Checkable")
                            << "Notifications are disabled for service '" << GetName() << "'.";
                        return;
                }
-
-               SetForceNextNotification(false);
        }
 
        Log(LogInformation, "Checkable")