mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-27 07:34:15 +02:00
Icinga DB: don't reimplement volatile state update in SendConfigUpdate
Sending a volatile state update is already implemented in UpdateState, so just use that function instead of generating the update queries.
This commit is contained in:
parent
a6d6cb788e
commit
447884be72
@ -1161,16 +1161,7 @@ void IcingaDB::SendConfigUpdate(const ConfigObject::Ptr& object, bool runtimeUpd
|
|||||||
CreateConfigUpdate(object, typeName, hMSets, runtimeUpdates, runtimeUpdate);
|
CreateConfigUpdate(object, typeName, hMSets, runtimeUpdates, runtimeUpdate);
|
||||||
Checkable::Ptr checkable = dynamic_pointer_cast<Checkable>(object);
|
Checkable::Ptr checkable = dynamic_pointer_cast<Checkable>(object);
|
||||||
if (checkable) {
|
if (checkable) {
|
||||||
String objectKey = GetObjectIdentifier(object);
|
UpdateState(checkable, runtimeUpdate ? StateUpdate::Full : StateUpdate::Volatile);
|
||||||
Dictionary::Ptr state = SerializeState(checkable);
|
|
||||||
String checksum = HashValue(state);
|
|
||||||
|
|
||||||
m_Rcon->FireAndForgetQuery({"HSET", m_PrefixConfigObject + typeName + ":state", objectKey, JsonEncode(state)}, Prio::RuntimeStateSync);
|
|
||||||
m_Rcon->FireAndForgetQuery({"HSET", m_PrefixConfigCheckSum + typeName + ":state", objectKey, JsonEncode(new Dictionary({{"checksum", checksum}}))}, Prio::RuntimeStateSync);
|
|
||||||
|
|
||||||
if (runtimeUpdate) {
|
|
||||||
UpdateState(checkable, StateUpdate::RuntimeOnly);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::vector<String> > transaction = {{"MULTI"}};
|
std::vector<std::vector<String> > transaction = {{"MULTI"}};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user