| 2943 | } |
| 2944 | |
| 2945 | void IcingaDB::VersionChangedHandler(const ConfigObject::Ptr& object) |
| 2946 | { |
| 2947 | Type::Ptr type = object->GetReflectionType(); |
| 2948 | auto it = std::find_if(std::begin(l_SyncableTypes), std::end(l_SyncableTypes), [&type](const auto& pair) { |
| 2949 | return pair.first == type; |
| 2950 | }); |
| 2951 | if (it == std::end(l_SyncableTypes)) { |
| 2952 | return; |
| 2953 | } |
| 2954 | |
| 2955 | if (object->IsActive()) { |
| 2956 | for (const IcingaDB::Ptr& rw : ConfigType::GetObjectsByType<IcingaDB>()) { |
| 2957 | // A runtime config change triggers also a full state update as well as next update event. |
| 2958 | rw->EnqueueConfigObject(object, icingadb::task_queue::ConfigUpdate | icingadb::task_queue::FullState | icingadb::task_queue::NextUpdate); |
| 2959 | } |
| 2960 | } else if (!object->IsActive() && object->GetExtension("ConfigObjectDeleted")) { // same as in apilistener-configsync.cpp |
| 2961 | for (const IcingaDB::Ptr& rw : ConfigType::GetObjectsByType<IcingaDB>()) { |
| 2962 | rw->SendConfigDelete(object); |
| 2963 | } |
| 2964 | } |
| 2965 | } |
| 2966 | |
| 2967 | void IcingaDB::DowntimeStartedHandler(const Downtime::Ptr& downtime) |
| 2968 | { |
nothing calls this directly
no test coverage detected