]> granicus.if.org Git - icinga2/commitdiff
Merge pull request #6896 from Icinga/bugfix/notification-delay-5561
authorMichael Friedrich <michael.friedrich@icinga.com>
Fri, 22 Feb 2019 08:27:59 +0000 (09:27 +0100)
committerGitHub <noreply@github.com>
Fri, 22 Feb 2019 08:27:59 +0000 (09:27 +0100)
Notification#BeginExecuteNotification(): SetNextNotification() correctly

1  2 
lib/icinga/notification.cpp

index 41982cd309e0dc65dcaddb9f9eaca75f4db89816,09b5c11062bf5360b8b3ac87eaa156c17a0cb10b..507c814c0d3847b1e0cd8fd8a7dca50698427fc6
@@@ -286,15 -284,13 +286,13 @@@ void Notification::BeginExecuteNotifica
  
                        if (timesBegin != Empty && timesBegin >= 0 && now < checkable->GetLastHardStateChange() + timesBegin) {
                                Log(LogNotice, "Notification")
 -                                      << "Not sending " << (reminder ? "reminder " : " ") << "notifications for notification object '" << GetName()
 -                                      << "': before specified begin time (" << Utility::FormatDuration(timesBegin) << ")";
 +                                      << "Not sending " << (reminder ? "reminder " : " ") << "notifications for notification object '"
 +                                      << notificationName << "': before specified begin time (" << Utility::FormatDuration(timesBegin) << ")";
  
                                /* we need to adjust the next notification time
-                                * to now + begin delaying the first notification
+                                * delaying the first notification
                                 */
-                               double nextProposedNotification = now + timesBegin + 1.0;
-                               if (GetNextNotification() > nextProposedNotification)
-                                       SetNextNotification(nextProposedNotification);
+                               SetNextNotification(checkable->GetLastHardStateChange() + timesBegin + 1.0);
  
                                return;
                        }