mirror of
https://github.com/Icinga/icinga2.git
synced 2025-04-08 17:05:25 +02:00
parent
f08bca220d
commit
ff5a35b7db
@ -32,16 +32,19 @@ REGISTER_TYPE(TimePeriod);
|
||||
|
||||
static Timer::Ptr l_UpdateTimer;
|
||||
|
||||
void TimePeriod::Start(void)
|
||||
{
|
||||
DynamicObject::Start();
|
||||
INITIALIZE_ONCE(&TimePeriod::StaticInitialize);
|
||||
|
||||
if (!l_UpdateTimer) {
|
||||
void TimePeriod::StaticInitialize(void)
|
||||
{
|
||||
l_UpdateTimer = make_shared<Timer>();
|
||||
l_UpdateTimer->SetInterval(300);
|
||||
l_UpdateTimer->OnTimerExpired.connect(boost::bind(&TimePeriod::UpdateTimerHandler));
|
||||
l_UpdateTimer->Start();
|
||||
}
|
||||
}
|
||||
|
||||
void TimePeriod::Start(void)
|
||||
{
|
||||
DynamicObject::Start();
|
||||
|
||||
/* Pre-fill the time period for the next 24 hours. */
|
||||
double now = Utility::GetTime();
|
||||
|
@ -38,6 +38,8 @@ public:
|
||||
DECLARE_PTR_TYPEDEFS(TimePeriod);
|
||||
DECLARE_TYPENAME(TimePeriod);
|
||||
|
||||
static void StaticInitialize(void);
|
||||
|
||||
virtual void Start(void);
|
||||
|
||||
void UpdateRegion(double begin, double end, bool clearExisting);
|
||||
|
Loading…
x
Reference in New Issue
Block a user