mirror of https://github.com/Icinga/icinga2.git
Fix example time period.
This commit is contained in:
parent
e6553a7140
commit
6e251251f0
|
@ -22,6 +22,7 @@
|
||||||
#include "base/dynamictype.h"
|
#include "base/dynamictype.h"
|
||||||
#include "base/logger_fwd.h"
|
#include "base/logger_fwd.h"
|
||||||
#include "base/objectlock.h"
|
#include "base/objectlock.h"
|
||||||
|
#include "base/utility.h"
|
||||||
|
|
||||||
using namespace icinga;
|
using namespace icinga;
|
||||||
|
|
||||||
|
@ -44,7 +45,7 @@ Script::Script(const Dictionary::Ptr& serializedUpdate)
|
||||||
*/
|
*/
|
||||||
void Script::Start(void)
|
void Script::Start(void)
|
||||||
{
|
{
|
||||||
assert(OwnsLock());
|
ASSERT(OwnsLock());
|
||||||
|
|
||||||
SpawnInterpreter();
|
SpawnInterpreter();
|
||||||
}
|
}
|
||||||
|
@ -74,7 +75,7 @@ String Script::GetCode(void) const
|
||||||
*/
|
*/
|
||||||
void Script::OnAttributeUpdate(const String& name)
|
void Script::OnAttributeUpdate(const String& name)
|
||||||
{
|
{
|
||||||
assert(!OwnsLock());
|
ASSERT(!OwnsLock());
|
||||||
|
|
||||||
if (name == "language" || name == "code")
|
if (name == "language" || name == "code")
|
||||||
SpawnInterpreter();
|
SpawnInterpreter();
|
||||||
|
|
|
@ -49,7 +49,7 @@ PerfdataWriter::~PerfdataWriter(void)
|
||||||
*/
|
*/
|
||||||
void PerfdataWriter::OnAttributeChanged(const String& name)
|
void PerfdataWriter::OnAttributeChanged(const String& name)
|
||||||
{
|
{
|
||||||
assert(!OwnsLock());
|
ASSERT(!OwnsLock());
|
||||||
|
|
||||||
if (name == "rotation_interval") {
|
if (name == "rotation_interval") {
|
||||||
m_RotationTimer->SetInterval(GetRotationInterval());
|
m_RotationTimer->SetInterval(GetRotationInterval());
|
||||||
|
|
|
@ -329,7 +329,7 @@ void TimePeriod::EvenMinutesTimePeriodUpdate(const ScriptTask::Ptr& task, const
|
||||||
if ((t % 2) == 0) {
|
if ((t % 2) == 0) {
|
||||||
Dictionary::Ptr segment = boost::make_shared<Dictionary>();
|
Dictionary::Ptr segment = boost::make_shared<Dictionary>();
|
||||||
segment->Set("begin", t * 60);
|
segment->Set("begin", t * 60);
|
||||||
segment->Set("end", t * 61);
|
segment->Set("end", (t + 1) * 60);
|
||||||
|
|
||||||
segments->Add(segment);
|
segments->Add(segment);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue