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

Method DependencyGroupChildRegisteredHandler

lib/icingadb/icingadb-objects.cpp:3033–3050  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3031}
3032
3033void IcingaDB::DependencyGroupChildRegisteredHandler(const Checkable::Ptr& child, const DependencyGroup::Ptr& dependencyGroup)
3034{
3035 for (const auto& rw : ConfigType::GetObjectsByType<IcingaDB>()) {
3036 rw->EnqueueConfigObject(child, icingadb::task_queue::FullState); // Child requires a full state update.
3037 rw->EnqueueDependencyChildRegistered(dependencyGroup, child);
3038 rw->EnqueueDependencyGroupStateUpdate(dependencyGroup);
3039
3040 std::set<Checkable::Ptr> parents;
3041 dependencyGroup->LoadParents(parents);
3042 for (const auto& parent : parents) {
3043 // The total_children and affects_children columns might now have different outcome, so update the parent
3044 // Checkable as well. The grandparent Checkable may still have wrong numbers of total children, though it's
3045 // not worth traversing the whole tree way up and sending config updates for each one of them, as the next
3046 // Redis config dump is going to fix it anyway.
3047 rw->EnqueueConfigObject(parent, icingadb::task_queue::ConfigUpdate | icingadb::task_queue::FullState);
3048 }
3049 }
3050}
3051
3052void IcingaDB::DependencyGroupChildRemovedHandler(const DependencyGroup::Ptr& dependencyGroup, const std::vector<Dependency::Ptr>& dependencies, bool removeGroup)
3053{

Callers

nothing calls this directly

Tested by

no test coverage detected