mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-08 22:34:30 +02:00
Stop object in reversed activation priority order
This stops the checker component first, then notifications, then features, then config objects, then the API feature and logger(s). Patch taken from @al2klimov
This commit is contained in:
parent
9d5dc4afc1
commit
a25e2b1038
@ -617,7 +617,15 @@ void ConfigObject::RestoreObjects(const String& filename, int attributeTypes)
|
|||||||
|
|
||||||
void ConfigObject::StopObjects()
|
void ConfigObject::StopObjects()
|
||||||
{
|
{
|
||||||
for (const Type::Ptr& type : Type::GetAllTypes()) {
|
std::vector<Type::Ptr> types = Type::GetAllTypes();
|
||||||
|
|
||||||
|
std::sort(types.begin(), types.end(), [](const Type::Ptr& a, const Type::Ptr& b) {
|
||||||
|
if (a->GetActivationPriority() > b->GetActivationPriority())
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
for (const Type::Ptr& type : types) {
|
||||||
auto *dtype = dynamic_cast<ConfigType *>(type.get());
|
auto *dtype = dynamic_cast<ConfigType *>(type.get());
|
||||||
|
|
||||||
if (!dtype)
|
if (!dtype)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user