mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-27 07:34:15 +02:00
parent
f72f7d87c7
commit
8251a60044
@ -315,6 +315,7 @@ void DynamicObject::RestoreObject(const String& message, int attributeTypes)
|
|||||||
Dictionary::Ptr update = persistentObject->Get("update");
|
Dictionary::Ptr update = persistentObject->Get("update");
|
||||||
Deserialize(object, update, false, attributeTypes);
|
Deserialize(object, update, false, attributeTypes);
|
||||||
object->OnStateLoaded();
|
object->OnStateLoaded();
|
||||||
|
object->SetStateLoaded(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DynamicObject::RestoreObjects(const String& filename, int attributeTypes)
|
void DynamicObject::RestoreObjects(const String& filename, int attributeTypes)
|
||||||
@ -341,8 +342,21 @@ void DynamicObject::RestoreObjects(const String& filename, int attributeTypes)
|
|||||||
|
|
||||||
upq.Join();
|
upq.Join();
|
||||||
|
|
||||||
|
unsigned long no_state = 0;
|
||||||
|
|
||||||
|
BOOST_FOREACH(const DynamicType::Ptr& type, DynamicType::GetTypes()) {
|
||||||
|
BOOST_FOREACH(const DynamicObject::Ptr& object, type->GetObjects()) {
|
||||||
|
if (!object->GetStateLoaded()) {
|
||||||
|
object->OnStateLoaded();
|
||||||
|
object->SetStateLoaded(true);
|
||||||
|
|
||||||
|
no_state++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Log(LogInformation, "DynamicObject")
|
Log(LogInformation, "DynamicObject")
|
||||||
<< "Restored " << restored << " objects";
|
<< "Restored " << restored << " objects. Loaded " << no_state << " new objects without state.";
|
||||||
}
|
}
|
||||||
|
|
||||||
void DynamicObject::StopObjects(void)
|
void DynamicObject::StopObjects(void)
|
||||||
|
@ -62,6 +62,8 @@ abstract class DynamicObject
|
|||||||
[protected] Dictionary::Ptr extensions;
|
[protected] Dictionary::Ptr extensions;
|
||||||
|
|
||||||
[state] Value override_vars;
|
[state] Value override_vars;
|
||||||
|
|
||||||
|
[protected] bool state_loaded;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user