Drop IcingaDB#SendEvent()

This commit is contained in:
Alexander A. Klimov 2020-03-04 11:24:07 +01:00
parent 867481de7c
commit 54d555bd92
2 changed files with 0 additions and 25 deletions

View File

@ -176,36 +176,12 @@ void IcingaDB::HandleEvents()
if (!event) if (!event)
continue; continue;
m_WorkQueue.Enqueue([this, event]() { SendEvent(event); });
} }
queue->RemoveClient(this); queue->RemoveClient(this);
EventQueue::UnregisterIfUnused(queueName, queue); EventQueue::UnregisterIfUnused(queueName, queue);
} }
void IcingaDB::SendEvent(const Dictionary::Ptr& event)
{
AssertOnWorkQueue();
if (!m_Rcon || !m_Rcon->IsConnected())
return;
String type = event->Get("type");
if (type.Contains("Acknowledgement")) {
Checkable::Ptr checkable;
if (event->Contains("service")) {
checkable = Service::GetByNamePair(event->Get("host"), event->Get("service"));
event->Set("service_id", GetObjectIdentifier(checkable));
} else {
checkable = Host::GetByName(event->Get("host"));
event->Set("host_id", GetObjectIdentifier(checkable));
}
}
}
void IcingaDB::Stop(bool runtimeRemoved) void IcingaDB::Stop(bool runtimeRemoved)
{ {
Log(LogInformation, "IcingaDB") Log(LogInformation, "IcingaDB")

View File

@ -38,7 +38,6 @@ private:
void ReconnectTimerHandler(); void ReconnectTimerHandler();
void TryToReconnect(); void TryToReconnect();
void HandleEvents(); void HandleEvents();
void SendEvent(const Dictionary::Ptr& event);
void PublishStatsTimerHandler(); void PublishStatsTimerHandler();
void PublishStats(); void PublishStats();