Fix example time period.

This commit is contained in:
Gunnar Beutner 2013-03-18 11:59:26 +01:00
parent e6553a7140
commit 6e251251f0
3 changed files with 5 additions and 4 deletions

View File

@ -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();

View File

@ -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());

View File

@ -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);
} }