mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-21 04:34:43 +02:00
Removed test code from the Service class.
This commit is contained in:
parent
ee2c14414c
commit
51aaa23faa
@ -69,15 +69,18 @@ long Service::GetRetryInterval(void) const
|
|||||||
|
|
||||||
void Service::SetNextCheck(time_t nextCheck)
|
void Service::SetNextCheck(time_t nextCheck)
|
||||||
{
|
{
|
||||||
m_NextCheck = nextCheck;
|
GetConfigObject()->SetProperty("next_check", nextCheck);
|
||||||
}
|
}
|
||||||
|
|
||||||
time_t Service::GetNextCheck(void)
|
time_t Service::GetNextCheck(void)
|
||||||
{
|
{
|
||||||
if (m_NextCheck == -1)
|
long value = -1;
|
||||||
m_NextCheck = time(NULL) + rand() % GetCheckInterval();
|
GetConfigObject()->GetProperty("next_check", &value);
|
||||||
|
if (value == -1) {
|
||||||
return m_NextCheck;
|
value = time(NULL) + rand() % GetCheckInterval();
|
||||||
|
SetNextCheck(value);
|
||||||
|
}
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Service::SetChecker(string checker)
|
void Service::SetChecker(string checker)
|
||||||
|
@ -8,7 +8,7 @@ class I2_ICINGA_API Service : public ConfigObjectAdapter
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Service(const ConfigObject::Ptr& configObject)
|
Service(const ConfigObject::Ptr& configObject)
|
||||||
: ConfigObjectAdapter(configObject), m_NextCheck(-1)
|
: ConfigObjectAdapter(configObject)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
string GetDisplayName(void) const;
|
string GetDisplayName(void) const;
|
||||||
@ -24,9 +24,6 @@ public:
|
|||||||
time_t GetNextCheck(void);
|
time_t GetNextCheck(void);
|
||||||
void SetChecker(string checker);
|
void SetChecker(string checker);
|
||||||
string GetChecker(void) const;
|
string GetChecker(void) const;
|
||||||
|
|
||||||
private:
|
|
||||||
time_t m_NextCheck;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user