MCPcopy Create free account
hub / github.com/Icinga/icinga2 / ObjectHandler

Method ObjectHandler

lib/checker/checkercomponent.cpp:301–326  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

299}
300
301void CheckerComponent::ObjectHandler(const ConfigObject::Ptr& object)
302{
303 Checkable::Ptr checkable = dynamic_pointer_cast<Checkable>(object);
304
305 if (!checkable)
306 return;
307
308 Zone::Ptr zone = Zone::GetByName(checkable->GetZoneName());
309 bool same_zone = (!zone || Zone::GetLocalZone() == zone);
310
311 {
312 std::unique_lock<std::mutex> lock(m_Mutex);
313
314 if (object->IsActive() && !object->IsPaused() && same_zone) {
315 if (m_PendingCheckables.find(checkable) != m_PendingCheckables.end())
316 return;
317
318 m_IdleCheckables.insert(GetCheckableScheduleInfo(checkable));
319 } else {
320 m_IdleCheckables.erase(checkable);
321 m_PendingCheckables.erase(checkable);
322 }
323
324 m_CV.notify_all();
325 }
326}
327
328CheckableScheduleInfo CheckerComponent::GetCheckableScheduleInfo(const Checkable::Ptr& checkable)
329{

Callers

nothing calls this directly

Calls 6

IsActiveMethod · 0.80
IsPausedMethod · 0.80
findMethod · 0.80
endMethod · 0.45
insertMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected