From ff0efbc2a2b6d71365325bb97002a68f626d52d5 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Wed, 4 Mar 2020 11:26:02 +0100 Subject: [PATCH] Drop IcingaDB#HandleEvents() --- lib/icingadb/icingadb.cpp | 29 ----------------------------- lib/icingadb/icingadb.hpp | 1 - 2 files changed, 30 deletions(-) diff --git a/lib/icingadb/icingadb.cpp b/lib/icingadb/icingadb.cpp index 8dc49e6fa..6e68084b7 100644 --- a/lib/icingadb/icingadb.cpp +++ b/lib/icingadb/icingadb.cpp @@ -81,9 +81,6 @@ void IcingaDB::Start(bool runtimeCreated) m_WorkQueue.SetName("IcingaDB"); - boost::thread thread(&IcingaDB::HandleEvents, this); - thread.detach(); - m_Rcon->SuppressQueryKind(Prio::CheckResult); m_Rcon->SuppressQueryKind(Prio::State); } @@ -156,32 +153,6 @@ void IcingaDB::PublishStats() 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 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) { Log(LogInformation, "IcingaDB") diff --git a/lib/icingadb/icingadb.hpp b/lib/icingadb/icingadb.hpp index ff826a48c..41fd0963c 100644 --- a/lib/icingadb/icingadb.hpp +++ b/lib/icingadb/icingadb.hpp @@ -37,7 +37,6 @@ public: private: void ReconnectTimerHandler(); void TryToReconnect(); - void HandleEvents(); void PublishStatsTimerHandler(); void PublishStats();