]> granicus.if.org Git - icinga2/commitdiff
Bug fix for reminder notifications.
authorGunnar Beutner <gunnar.beutner@netways.de>
Thu, 21 Mar 2013 14:24:00 +0000 (15:24 +0100)
committerGunnar Beutner <gunnar.beutner@netways.de>
Thu, 21 Mar 2013 14:24:00 +0000 (15:24 +0100)
components/notification/notificationcomponent.cpp

index 358da30527729cfa88760a16aa33a38e9ffe7741..9e474eb80dbe1c7a06c654d3e0d168ec95535a2e 100644 (file)
@@ -78,6 +78,8 @@ void NotificationComponent::NotificationTimerHandler(void)
                Service::Ptr service = notification->GetService();
                bool reachable = service->IsReachable();
 
+               notification->SetNextNotification(Utility::GetTime() + notification->GetNotificationInterval());
+
                bool send_notification;
 
                {
@@ -89,14 +91,10 @@ void NotificationComponent::NotificationTimerHandler(void)
                        if (service->GetState() == StateOK)
                                continue;
 
-                       send_notification = reachable && !service->IsInDowntime() && !service->IsAcknowledged();
+                       if (!reachable || service->IsInDowntime() || service->IsAcknowledged())
+                               continue;
                }
 
-               notification->SetNextNotification(Utility::GetTime() + notification->GetNotificationInterval());
-
-               if (!send_notification)
-                       continue;
-
                try {
                        Log(LogInformation, "notification", "Sending reminder notification for service '" + service->GetName() + "'");
                        notification->BeginExecuteNotification(NotificationProblem, service->GetLastCheckResult(), false);