]> granicus.if.org Git - icinga2/commitdiff
Allow Checkable#retry_interval to be 0
authorAlexander A. Klimov <alexander.klimov@icinga.com>
Wed, 9 Jan 2019 10:27:33 +0000 (11:27 +0100)
committerMichael Friedrich <michael.friedrich@icinga.com>
Mon, 11 Feb 2019 12:29:05 +0000 (13:29 +0100)
refs #6871

(cherry picked from commit 9ae738d17fa6220d988001e4c56155aa6535992c)

lib/icinga/checkable-check.cpp

index e70648d895d3a06b884c47c46d6e45e07a6d615f..b159247a9aac96a5ca6aee9f328cb9308b7365ad 100644 (file)
@@ -79,7 +79,8 @@ void Checkable::UpdateNextCheck(const MessageOrigin::Ptr& origin)
        if (interval > 1)
                adj = fmod(now * 100 + GetSchedulingOffset(), interval * 100) / 100.0;
 
-       adj = std::min(0.5 + fmod(GetSchedulingOffset(), interval * 5) / 100.0, adj);
+       if (adj != 0.0)
+               adj = std::min(0.5 + fmod(GetSchedulingOffset(), interval * 5) / 100.0, adj);
 
        double nextCheck = now - adj + interval;