mirror of https://github.com/Icinga/icinga2.git
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);
|
||||
Checkable::Ptr checkable = dynamic_pointer_cast<Checkable>(object);
|
||||
if (checkable) {
|
||||
String objectKey = GetObjectIdentifier(object);
|
||||
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);
|
||||
}
|
||||
UpdateState(checkable, runtimeUpdate ? StateUpdate::Full : StateUpdate::Volatile);
|
||||
}
|
||||
|
||||
std::vector<std::vector<String> > transaction = {{"MULTI"}};
|
||||
|
|
Loading…
Reference in New Issue