mirror of
https://github.com/Icinga/icinga2.git
synced 2025-04-08 17:05:25 +02:00
IcingaDB::PrepareObject(): round Notification#interval and limit it to >=0
otherwise, e.g. with -42.5, the Go daemon crashes. It expects uints there.
This commit is contained in:
parent
a3dabde28a
commit
273aa6f997
@ -32,6 +32,7 @@
|
||||
#include "remote/zone.hpp"
|
||||
#include <algorithm>
|
||||
#include <chrono>
|
||||
#include <cmath>
|
||||
#include <cstdint>
|
||||
#include <iterator>
|
||||
#include <map>
|
||||
@ -1387,7 +1388,7 @@ bool IcingaDB::PrepareObject(const ConfigObject::Ptr& object, Dictionary::Ptr& a
|
||||
attributes->Set("times_end",notification->GetTimes()->Get("end"));
|
||||
}
|
||||
|
||||
attributes->Set("notification_interval", notification->GetInterval());
|
||||
attributes->Set("notification_interval", std::max(0.0, std::round(notification->GetInterval())));
|
||||
attributes->Set("states", notification->GetStates());
|
||||
attributes->Set("types", notification->GetTypes());
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user