mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-24 06:05:01 +02:00
Check if RedisConnection exists before checking connection
This commit is contained in:
parent
a056e14834
commit
5f64d809d7
@ -153,7 +153,7 @@ static ConfigObject::Ptr GetObjectByName(const String& name)
|
|||||||
// Used to update a single object, used for runtime updates
|
// Used to update a single object, used for runtime updates
|
||||||
void RedisWriter::SendConfigUpdate(const ConfigObject::Ptr& object, bool runtimeUpdate)
|
void RedisWriter::SendConfigUpdate(const ConfigObject::Ptr& object, bool runtimeUpdate)
|
||||||
{
|
{
|
||||||
if (!m_Rcon->IsConnected())
|
if (!m_Rcon || !m_Rcon->IsConnected())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
String typeName = GetLowerCaseTypeNameDB(object);
|
String typeName = GetLowerCaseTypeNameDB(object);
|
||||||
|
@ -111,7 +111,7 @@ void RedisWriter::TryToReconnect()
|
|||||||
else
|
else
|
||||||
m_Rcon->Start();
|
m_Rcon->Start();
|
||||||
|
|
||||||
if (!m_Rcon->IsConnected())
|
if (!m_Rcon || !m_Rcon->IsConnected())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
UpdateSubscriptions();
|
UpdateSubscriptions();
|
||||||
@ -145,7 +145,7 @@ void RedisWriter::UpdateSubscriptions()
|
|||||||
* But since we expect and answer here and break Icinga in case of receiving no answer/an unexpected one we opt for
|
* But since we expect and answer here and break Icinga in case of receiving no answer/an unexpected one we opt for
|
||||||
* better safe than sorry here. Future implementation needs to include an improved error handling and answer verification.
|
* better safe than sorry here. Future implementation needs to include an improved error handling and answer verification.
|
||||||
*/
|
*/
|
||||||
if (!m_Rcon->IsConnected())
|
if (!m_Rcon || !m_Rcon->IsConnected())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
long long cursor = 0;
|
long long cursor = 0;
|
||||||
@ -220,7 +220,7 @@ void RedisWriter::PublishStats()
|
|||||||
{
|
{
|
||||||
AssertOnWorkQueue();
|
AssertOnWorkQueue();
|
||||||
|
|
||||||
if (!m_Rcon->IsConnected())
|
if (!m_Rcon || !m_Rcon->IsConnected())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Dictionary::Ptr status = GetStats();
|
Dictionary::Ptr status = GetStats();
|
||||||
@ -303,7 +303,7 @@ void RedisWriter::SendEvent(const Dictionary::Ptr& event)
|
|||||||
{
|
{
|
||||||
AssertOnWorkQueue();
|
AssertOnWorkQueue();
|
||||||
|
|
||||||
if (!m_Rcon->IsConnected())
|
if (!m_Rcon || !m_Rcon->IsConnected())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
String type = event->Get("type");
|
String type = event->Get("type");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user