Skip to content

Commit

Permalink
Merge pull request #7764 from Icinga/bugfix/fix-crash-in-docker-envir…
Browse files Browse the repository at this point in the history
…onments

IcingaDB::UpdateState: Check for Redis connection before calling FireAndForgetQuery()
  • Loading branch information
N-o-X authored Jan 17, 2020
2 parents f11cccf + 0d28ef5 commit 18eb06e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/icingadb/icingadb-objects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 18eb06e

Please sign in to comment.