mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-26 23:24:09 +02:00
Drop IcingaDB#HandleEvents()
This commit is contained in:
parent
54d555bd92
commit
ff0efbc2a2
@ -81,9 +81,6 @@ void IcingaDB::Start(bool runtimeCreated)
|
|||||||
|
|
||||||
m_WorkQueue.SetName("IcingaDB");
|
m_WorkQueue.SetName("IcingaDB");
|
||||||
|
|
||||||
boost::thread thread(&IcingaDB::HandleEvents, this);
|
|
||||||
thread.detach();
|
|
||||||
|
|
||||||
m_Rcon->SuppressQueryKind(Prio::CheckResult);
|
m_Rcon->SuppressQueryKind(Prio::CheckResult);
|
||||||
m_Rcon->SuppressQueryKind(Prio::State);
|
m_Rcon->SuppressQueryKind(Prio::State);
|
||||||
}
|
}
|
||||||
@ -156,32 +153,6 @@ void IcingaDB::PublishStats()
|
|||||||
m_Rcon->FireAndForgetQuery(std::move(eval), Prio::Heartbeat);
|
m_Rcon->FireAndForgetQuery(std::move(eval), Prio::Heartbeat);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IcingaDB::HandleEvents()
|
|
||||||
{
|
|
||||||
String queueName = Utility::NewUniqueID();
|
|
||||||
EventQueue::Ptr queue = new EventQueue(queueName);
|
|
||||||
EventQueue::Register(queueName, queue);
|
|
||||||
|
|
||||||
std::set<String> types;
|
|
||||||
types.insert("CheckResult");
|
|
||||||
types.insert("AcknowledgementSet");
|
|
||||||
types.insert("AcknowledgementCleared");
|
|
||||||
|
|
||||||
queue->SetTypes(types);
|
|
||||||
|
|
||||||
queue->AddClient(this);
|
|
||||||
|
|
||||||
for (;;) {
|
|
||||||
Dictionary::Ptr event = queue->WaitForEvent(this);
|
|
||||||
|
|
||||||
if (!event)
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
queue->RemoveClient(this);
|
|
||||||
EventQueue::UnregisterIfUnused(queueName, queue);
|
|
||||||
}
|
|
||||||
|
|
||||||
void IcingaDB::Stop(bool runtimeRemoved)
|
void IcingaDB::Stop(bool runtimeRemoved)
|
||||||
{
|
{
|
||||||
Log(LogInformation, "IcingaDB")
|
Log(LogInformation, "IcingaDB")
|
||||||
|
@ -37,7 +37,6 @@ public:
|
|||||||
private:
|
private:
|
||||||
void ReconnectTimerHandler();
|
void ReconnectTimerHandler();
|
||||||
void TryToReconnect();
|
void TryToReconnect();
|
||||||
void HandleEvents();
|
|
||||||
|
|
||||||
void PublishStatsTimerHandler();
|
void PublishStatsTimerHandler();
|
||||||
void PublishStats();
|
void PublishStats();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user