mirror of https://github.com/Icinga/icinga2.git
Add missing DowntimesExpireTimer.
now the expired downtimes will get deleted every 60 seconds. fixes #4711
This commit is contained in:
parent
9a21af719d
commit
46659e7551
|
@ -289,6 +289,16 @@ bool Service::IsDowntimeExpired(const Dictionary::Ptr& downtime)
|
|||
return (downtime->Get("end_time") < Utility::GetTime());
|
||||
}
|
||||
|
||||
void Service::StartDowntimesExpiredTimer(void)
|
||||
{
|
||||
if (!l_DowntimesExpireTimer) {
|
||||
l_DowntimesExpireTimer = boost::make_shared<Timer>();
|
||||
l_DowntimesExpireTimer->SetInterval(60);
|
||||
l_DowntimesExpireTimer->OnTimerExpired.connect(boost::bind(&Service::DowntimesExpireTimerHandler));
|
||||
l_DowntimesExpireTimer->Start();
|
||||
}
|
||||
}
|
||||
|
||||
void Service::AddDowntimesToCache(void)
|
||||
{
|
||||
Log(LogDebug, "icinga", "Updating Service downtimes cache.");
|
||||
|
|
|
@ -51,6 +51,8 @@ void Service::Start(void)
|
|||
|
||||
AddDowntimesToCache();
|
||||
AddCommentsToCache();
|
||||
|
||||
StartDowntimesExpiredTimer();
|
||||
}
|
||||
|
||||
void Service::OnConfigLoaded(void)
|
||||
|
|
|
@ -275,6 +275,8 @@ public:
|
|||
static bool IsDowntimeTriggered(const Dictionary::Ptr& downtime);
|
||||
static bool IsDowntimeExpired(const Dictionary::Ptr& downtime);
|
||||
|
||||
void StartDowntimesExpiredTimer(void);
|
||||
|
||||
bool IsInDowntime(void) const;
|
||||
bool IsAcknowledged(void);
|
||||
|
||||
|
|
Loading…
Reference in New Issue