mirror of https://github.com/Icinga/icinga2.git
Merge pull request #7764 from Icinga/bugfix/fix-crash-in-docker-environments
IcingaDB::UpdateState: Check for Redis connection before calling FireAndForgetQuery()
This commit is contained in:
commit
18eb06e334
|
@ -802,6 +802,9 @@ void IcingaDB::InsertObjectDependencies(const ConfigObject::Ptr& object, const S
|
|||
|
||||
void IcingaDB::UpdateState(const Checkable::Ptr& checkable)
|
||||
{
|
||||
if (!m_Rcon || !m_Rcon->IsConnected())
|
||||
return;
|
||||
|
||||
Dictionary::Ptr stateAttrs = SerializeState(checkable);
|
||||
|
||||
m_Rcon->FireAndForgetQuery({"HSET", m_PrefixStateObject + GetLowerCaseTypeNameDB(checkable), GetObjectIdentifier(checkable), JsonEncode(stateAttrs)}, Prio::State);
|
||||
|
|
Loading…
Reference in New Issue