compatido: make status update intervals some constants

This commit is contained in:
Michael Friedrich 2012-09-22 15:58:42 +02:00
parent 454adc5a90
commit 6aa01cacc6
1 changed files with 7 additions and 3 deletions

View File

@ -36,6 +36,10 @@ String CompatIdoComponent::GetName(void) const
*/ */
void CompatIdoComponent::Start(void) void CompatIdoComponent::Start(void)
{ {
const int StatusTimerInterval = 60;
const int ConfigTimerInterval = 3600;
const int ProgramStatusTimerInterval = 15;
/* HINTS - XXX /* HINTS - XXX
* - only tcp sockets * - only tcp sockets
* - only icinga idoutils 1.8 * - only icinga idoutils 1.8
@ -50,19 +54,19 @@ void CompatIdoComponent::Start(void)
* - tcp socket+port * - tcp socket+port
*/ */
m_StatusTimer = boost::make_shared<Timer>(); m_StatusTimer = boost::make_shared<Timer>();
m_StatusTimer->SetInterval(15); m_StatusTimer->SetInterval(StatusTimerInterval);
m_StatusTimer->OnTimerExpired.connect(boost::bind(&CompatIdoComponent::StatusTimerHandler, this)); m_StatusTimer->OnTimerExpired.connect(boost::bind(&CompatIdoComponent::StatusTimerHandler, this));
m_StatusTimer->Start(); m_StatusTimer->Start();
m_StatusTimer->Reschedule(0); m_StatusTimer->Reschedule(0);
m_ConfigTimer = boost::make_shared<Timer>(); m_ConfigTimer = boost::make_shared<Timer>();
m_ConfigTimer->SetInterval(15); m_ConfigTimer->SetInterval(ConfigTimerInterval);
m_ConfigTimer->OnTimerExpired.connect(boost::bind(&CompatIdoComponent::ConfigTimerHandler, this)); m_ConfigTimer->OnTimerExpired.connect(boost::bind(&CompatIdoComponent::ConfigTimerHandler, this));
m_ConfigTimer->Start(); m_ConfigTimer->Start();
m_ConfigTimer->Reschedule(0); m_ConfigTimer->Reschedule(0);
m_ProgramStatusTimer = boost::make_shared<Timer>(); m_ProgramStatusTimer = boost::make_shared<Timer>();
m_ProgramStatusTimer->SetInterval(15); m_ProgramStatusTimer->SetInterval(ProgramStatusTimerInterval);
m_ProgramStatusTimer->OnTimerExpired.connect(boost::bind(&CompatIdoComponent::ProgramStatusTimerHandler, this)); m_ProgramStatusTimer->OnTimerExpired.connect(boost::bind(&CompatIdoComponent::ProgramStatusTimerHandler, this));
m_ProgramStatusTimer->Start(); m_ProgramStatusTimer->Start();
m_ProgramStatusTimer->Reschedule(0); m_ProgramStatusTimer->Reschedule(0);