mirror of
https://github.com/Icinga/icinga2.git
synced 2026-02-20 00:10:29 -05:00
IcingaDB::UpdateState: Check for Redis connection before calling FireAndForgetQuery()
This commit is contained in:
parent
f11cccf874
commit
0d28ef5abe
1 changed files with 3 additions and 0 deletions
|
|
@ -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 a new issue