mirror of https://github.com/Icinga/icinga2.git
IcingaDB: start parent connection after children are initialized
The loop in the connected callback of the parent connection uses m_Rcons which previously was only initialized after that connection was already started.
This commit is contained in:
parent
f4b2bbc7af
commit
a50120c399
|
@ -68,6 +68,16 @@ void IcingaDB::Start(bool runtimeCreated)
|
||||||
GetEnableTls(), GetInsecureNoverify(), GetCertPath(), GetKeyPath(), GetCaPath(), GetCrlPath(),
|
GetEnableTls(), GetInsecureNoverify(), GetCertPath(), GetKeyPath(), GetCaPath(), GetCrlPath(),
|
||||||
GetTlsProtocolmin(), GetCipherList(), GetConnectTimeout(), GetDebugInfo());
|
GetTlsProtocolmin(), GetCipherList(), GetConnectTimeout(), GetDebugInfo());
|
||||||
|
|
||||||
|
for (const Type::Ptr& type : GetTypes()) {
|
||||||
|
auto ctype (dynamic_cast<ConfigType*>(type.get()));
|
||||||
|
if (!ctype)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
m_Rcons[ctype] = new RedisConnection(GetHost(), GetPort(), GetPath(), GetPassword(), GetDbIndex(),
|
||||||
|
GetEnableTls(), GetInsecureNoverify(), GetCertPath(), GetKeyPath(), GetCaPath(), GetCrlPath(),
|
||||||
|
GetTlsProtocolmin(), GetCipherList(), GetConnectTimeout(), GetDebugInfo(), m_Rcon);
|
||||||
|
}
|
||||||
|
|
||||||
auto connectedCallback ([this](boost::asio::yield_context& yc) {
|
auto connectedCallback ([this](boost::asio::yield_context& yc) {
|
||||||
m_WorkQueue.Enqueue([this]() { OnConnectedHandler(); });
|
m_WorkQueue.Enqueue([this]() { OnConnectedHandler(); });
|
||||||
});
|
});
|
||||||
|
@ -82,16 +92,6 @@ void IcingaDB::Start(bool runtimeCreated)
|
||||||
});
|
});
|
||||||
m_Rcon->Start();
|
m_Rcon->Start();
|
||||||
|
|
||||||
for (const Type::Ptr& type : GetTypes()) {
|
|
||||||
auto ctype (dynamic_cast<ConfigType*>(type.get()));
|
|
||||||
if (!ctype)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
m_Rcons[ctype] = new RedisConnection(GetHost(), GetPort(), GetPath(), GetPassword(), GetDbIndex(),
|
|
||||||
GetEnableTls(), GetInsecureNoverify(), GetCertPath(), GetKeyPath(), GetCaPath(), GetCrlPath(),
|
|
||||||
GetTlsProtocolmin(), GetCipherList(), GetConnectTimeout(), GetDebugInfo(), m_Rcon);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_StatsTimer = new Timer();
|
m_StatsTimer = new Timer();
|
||||||
m_StatsTimer->SetInterval(1);
|
m_StatsTimer->SetInterval(1);
|
||||||
m_StatsTimer->OnTimerExpired.connect([this](const Timer * const&) { PublishStatsTimerHandler(); });
|
m_StatsTimer->OnTimerExpired.connect([this](const Timer * const&) { PublishStatsTimerHandler(); });
|
||||||
|
|
Loading…
Reference in New Issue