Fix runtime update of state not being published

This commit is contained in:
Noah Hilverling 2019-09-19 08:06:56 +02:00 committed by Michael Friedrich
parent 07515d4446
commit 1566c4f9ac
1 changed files with 3 additions and 2 deletions

View File

@ -781,8 +781,9 @@ void RedisWriter::SendConfigUpdate(const ConfigObject::Ptr& object, bool runtime
CreateConfigUpdate(object, typeName, hMSets, publishes, runtimeUpdate);
Checkable::Ptr checkable = dynamic_pointer_cast<Checkable>(object);
if (checkable) {
m_Rcon->FireAndForgetQuery({"HSET", m_PrefixStateObject + typeName,
GetObjectIdentifier(checkable), JsonEncode(SerializeState(checkable))});
String objectKey = GetObjectIdentifier(object);
m_Rcon->FireAndForgetQuery({"HSET", m_PrefixStateObject + typeName, objectKey, JsonEncode(SerializeState(checkable))});
publishes["icinga:config:update"].emplace_back("state:" + typeName + ":" + objectKey);
}
std::vector<std::vector<String> > transaction = {{"MULTI"}};